home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / game10 / game.doc < prev    next >
Encoding:
Text File  |  1994-04-05  |  174.0 KB  |  4,445 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.    ┌─┐┌─┐┬  ┬  ─┬─┌ ┐┌─┐┌─┐  ┌─┐┌─┐┌─┐─┬─┌ ┐┌─┐┌─┐┌─┐ ┐ ┌─┐
  13.    │┌┐│ ││  │   │ ││││ ││┌┐  └─┐│ │├─  │ │││├─┤├┬┘├─    └─┐
  14.    └─┘└─┘└─┘└─┘─┴─└┴┘└─┘└─┘  └─┘└─┘└   ┴ └┴┘└ ┘┴└┘└─┘   └─┘
  15. ──────────────────────────────────────────────────────────────
  16.  
  17.  G∙A∙M∙E - Gaming Applications Made Easy, Version 1.1
  18.                    Copyright 1992,93,94 by Lennert Bakker
  19.                    All rights reserved
  20.  
  21.  
  22.  "The most complete toolkit available when it comes to
  23.   writing games, demonstrations and educational software!"
  24.  
  25. ──────────────────────────────────────────────────────────────
  26.  
  27.      
  28.                        Table of contents
  29.  
  30.  
  31.  
  32.           Chapter 1: G∙A∙M∙E, an introduction
  33.  
  34.             1.1 What IS this program?
  35.             1.2 System requirements
  36.             1.3 Registering your copy of G∙A∙M∙E
  37.             1.4 Disclaimer
  38.             1.5 What's there to come?
  39.             1.6 Support and distribution
  40.             1.7 Special thanks must go out to...
  41.  
  42.  
  43.           Chapter 2: Getting started, a quick overview
  44.  
  45.             2.1 The basic idea...
  46.             2.2 and my implementation
  47.             2.3 An example program
  48.  
  49.  
  50.           Chapter 3: The G∙A∙M∙E units, what do they do?
  51.  
  52.             3.1  TGK_MAIN; The general stuff
  53.             3.2  TGK_GP; Some graphics-primitives
  54.             3.3  TGK_IO; User-interaction made easy
  55.             3.4  TGK_BM; Bitmapping and the like
  56.             3.5  TGK_SND; For your listening pleasure
  57.             3.6  TGK_WIN; A Graphical User Interface (GUI)
  58.             3.7  TGK_3D; Vector graphics take off
  59.             3.8  TGK_TEXT; Get the message out!
  60.             3.9  TGK_ANIM; Look mom, it's moving...
  61.             3.10 TGK_FILE; File handling routines
  62.  
  63.  
  64.           Chapter 4: Utility programs
  65.  
  66.             4.1 GAMECAP; A screen-capture program
  67.             4.2 ANIMEDIT; A full-featured animation editor
  68.             4.3 ROL2GMF; A music-conversion program
  69.             4.4 GAMEFONT; A font-conversion program
  70.             4.5 MAKERES; A resource-file creator
  71.  
  72.  
  73.           Chapter 5: G∙A∙M∙E reference manual
  74.  
  75.  
  76.           Appendix A: KeyBoard ScanCodes
  77.  
  78.  
  79.  
  80.  
  81.  
  82.      In silent contemplation:
  83.      (Wat heb je nu geleerd, spelend jongetje?)
  84.  
  85.       What can I say? So now I've been alive for some 20 years
  86.       and I can't help wondering: 
  87.  
  88.      "What is it that I've learned?"
  89.  
  90.       I was never made for writing documentation, I guess...
  91.  
  92.  
  93.  
  94.  
  95.  
  96.      A word on dedication:
  97.  
  98.      Hope you don't mind Kai, but I guess I'll dedicate this
  99.      to your sister. So kittenish she is...
  100.  
  101.  
  102.  
  103.  
  104.  
  105.      Someone had something to say about G∙A∙M∙E
  106.      and thus, I quote:
  107.  
  108.      "I recieved your G∙A∙M∙E-program just a few days ago and 
  109.       I have really been very impressed! Even though I am a
  110.       novice in vectorgraphics, your toolbox has been of great
  111.       help." -- Leif Nygaard
  112. Chapter 1: G∙A∙M∙E, an introduction
  113.  
  114.  
  115. 1.1 What IS this program?
  116.  
  117. You don't have to be an experienced programmer to create top
  118. of the notch games, demonstrations or educational programs;
  119. well, not anymore, that is. Now there's G∙A∙M∙E, a toolkit for
  120. Turbo Pascal programmers, allowing them to easily create the
  121. finest software without having to go through the hassle of
  122. writing all sorts of fast routines in assembly language,
  123. spending months trying to figure these out.
  124. Using G∙A∙M∙E, adding these routines is real easy. Simply grab
  125. a piece of music, load it and have it start playing in the
  126. background without ever even bothering about it anymore. Draw
  127. some frames, combine them to form an animation using G∙A∙M∙E's
  128. animation-editor and have them fly across the screen in full
  129. glory. G∙A∙M∙E handles all this, while you sit back and watch.
  130. Have you ever dreamt of writing games that would really knock
  131. others off their feet? Here's your ticket to ride. Have fun!
  132.  
  133.  
  134. 1.2 System requirements
  135.  
  136. This part is really straightforward. If Turbo Pascal works on
  137. your system, so will G∙A∙M∙E. The only other requirement is
  138. that your system has to be equipped with a VGA card and moni-
  139. tor. In addition, if you want to use G∙A∙M∙E's capabilities to
  140. the fullest, you will need an Adlib or Soundblaster compatible
  141. soundboard. It is also recommended that you use a 386-based
  142. machine and Turbo Pascal version 7. This way you will be able
  143. to run Turbo Pascal in protected mode, thus allowing you to
  144. compile larger programs from within the Turbo Pascal Integra-
  145. ted Environment. Of course, if you don't have a 386-machine,
  146. you could always compile your programs from the commandline.
  147.  
  148.  
  149. 1.3 Registering your copy of G∙A∙M∙E
  150.  
  151. G∙A∙M∙E is a shareware product, meaning that if you like this
  152. program and intend to use it in the future, you will have to
  153. register your copy. Registering has some major advantages. You
  154. will recieve the FULL SOURCE code to the product and you will
  155. be allowed to distribute your own programs created using 
  156. G∙A∙M∙E. There's no such thing as royality-fees and you will
  157. be absolutely free to use the registered version of G∙A∙M∙E in
  158. any way you like; you could make a lot of money distributing
  159. your own homebrewed software... The registration fee is $30 or
  160. an equivalent in your local currency. Please make your regist-
  161. ration (international postal money order or local currency)
  162. payable to:
  163.  
  164.           L.Bakker / G∙A∙M∙E Productions
  165.           Thierenskade 6
  166.           2282 XT, Rijswijk
  167.           The Netherlands
  168.  
  169.  
  170. 1.4 Disclaimer
  171.  
  172. "I (Lennert Bakker), hereby disclaim all warranties relating
  173. to this software, whether expressed or implied, including but
  174. not limited to any implied warranties of merchantability and
  175. fitness for a particular purpose. All such warranties are
  176. expressly and specifically disclaimed. Neither I, nor anyone
  177. else who has been involved in the creation, production or
  178. delivery of this software shall be liable for any indirect,
  179. consequential, or incidental damages arising out of the use
  180. or inability to use this software." There is NO warranty, 
  181. not of any kind.
  182.  
  183.  
  184. 1.5 What's there to come?
  185.  
  186. Coming up; some of the future plans I have for G∙A∙M∙E:
  187. I plan on adding support for various other soundboards, such
  188. as the Gravis Ultrasound, SoundBlaster Pro, Pro Audio Spectrum
  189. and Adlib Gold. What I need are programming specifications on
  190. these cards, or better yet an actual soundboard to test all
  191. these routines on... Does any company out there feel like
  192. supplying me with one of these cards and having their name
  193. mentioned here? Also, a really FAST tiling-sytem is in the
  194. making, allowing you to create games in the line of Commander
  195. Keen, Duke Nukem or Xargon... Furthermore, loads of changes
  196. and enhancements will be made; too much to go into right now,
  197. just find out, in the future. This product will definitely be
  198. too hot to handle!
  199.  
  200.  
  201. 1.6 Support and distribution
  202.  
  203. If you have any questions or comments regarding G∙A∙M∙E, or if
  204. you would like to obtain the latest version of G∙A∙M∙E, please
  205. call the official G∙A∙M∙E support- and distribution-site:
  206.  
  207.  ANDROMEDA, Tel. +31-(0)73-571599  -  Sysop: Rombout de Backer
  208.  Running on ZyXEL 19k2, Fax, Voice, v32bis & v42bis
  209.  File requests from 08:00-01:00 CET under magic-name GAME
  210.  or login as SUPPORT
  211.  
  212.  
  213. 1.7 Special thanks must go out to...
  214.  
  215. I would hereby like to thank some of the people who, through
  216. time, have helped me in creating the product you are in sight
  217. of; Daan van Rooien for giving me just that little bit of
  218. inspiration when I needed it most. Thijs Kuperus for helping
  219. me create some of the sound routines. My mom and dad, who kept
  220. telling me this would never work; "Hey, I will show them, I
  221. figured...". Rombout de Backer for his support when I thought
  222. the time had come to put this program to the test. Joris van
  223. Rongen and Elard Vermeulen for creating some great graphics. 
  224. Sean Palmer, Kai Rohrbacher, Soeren Holstebroe and Stefan
  225. Ohrhallinger for showing me some of the principals on how 
  226. graphics-programming is done. And thanks to you, Menno, for
  227. sparing me a couple of litres of coffee.
  228. Chapter 2: Getting started, a quick overview
  229.  
  230.  
  231. 2.1 The basic idea...
  232.  
  233. I can still remember one of those times when I had some plans
  234. on creating a game and I ended up with some source in BASIC.
  235. The wonderful part about it was that in those days, at times,
  236. I was actually impressed by what speed one could achieve with
  237. a little bit of thought on how the program had to be set up.
  238. One could even implement simple vector-graphics in BASIC. Not
  239. that they were anywhere near filled but hey, it was a start.
  240. A problem arose however, as soon as this game also had to have
  241. at least SOME figures moving about the screen in the form of
  242. what are called sprites... The only way to do this was by
  243. erasing an old figure and then quickly redrawing the new
  244. version on top of it. This would cause a lot of flicker on
  245. screen as the erasing and drawing of figures required massive
  246. amounts of processor-time. As a result, your animations would
  247. end up looking ghostly and vague.
  248.  
  249.  
  250. 2.2 and my implementation
  251.  
  252. So here's how we do it these days; We use the two-page con-
  253. cept, or rather the four-page concept as we actually have four
  254. pages to work with. The idea is to draw all your sprites on
  255. page A, while the monitor is displaying page B. Then we will
  256. quickly make page A the visible page and start drawing on page
  257. B. As the procedure that flips the pages executes very quic-
  258. kly, there will be no noticable flicker. But hey, you just
  259. mentioned we have four pages to work with, you will say; and
  260. indeed we do, so here's where we can get fancy. Imagine having
  261. a background picture on page C, which we will copy to the non-
  262. visible page before drawing anything else on this page. You
  263. guessed right; we can have our sprites drawn in front of the
  264. background picture. We could even have another picture on page
  265. D, so we can switch between these pictures as well... The
  266. whole G∙A∙M∙E package is actually based on this concept.
  267. Simply put, that is, of course... 8-)
  268. 2.3 An example program
  269.  
  270. To get a general idea of what can be done with G∙A∙M∙E and how
  271. it all works, please have a glance at the accompanying demon-
  272. stration program GAMEDEMO.PAS. In future versions of this
  273. manual, I will discuss in detail how the program works. As for
  274. now, you have got to live and learn. It's not that hard.
  275. Chapter 3: The G∙A∙M∙E units, what do they do?
  276.  
  277. As the G∙A∙M∙E program grew bigger and bigger, the need arose
  278. to split up all of the different routines in several groups.
  279. Currently, the program consists of nine different units, every
  280. one of them covering a certain range of routines. Thus, there
  281. is a unit to handle animations, a unit to handle music and
  282. sound effects, a unit to handle keyboard, mouse and joystick
  283. support, etc.
  284. You will now be presented with a general overview of all the
  285. G∙A∙M∙E units. I will try to describe in short what each unit
  286. does and in what way it can be of use to the programmer. All
  287. the constants, type definitions, procedures and functions for
  288. each of these units will also be listed here. 
  289. For a more detailed description of what the procedures and
  290. functions found in each of these units do and how they work,
  291. please consult chapter 5, the G∙A∙M∙E reference manual.
  292. 3.1 TGK_MAIN; The general stuff
  293.  
  294. The TGK_MAIN unit implements all of G∙A∙M∙E's basic routines,
  295. such as the ones needed to initialize and de-initialize the
  296. graphic mode. It also contains some basic procedures and data-
  297. types which need to be accessible to a lot of the other units,
  298. as well as some palette-handling and fading procedures. The
  299. TGK_MAIN unit provides you with all the necessary procedures
  300. to accomplish page-flipping, which is needed for smooth and
  301. fast animation. Here is the interface section of this unit:
  302.  
  303.  
  304. Type FillPatType = Array[0..15,0..15] of Byte;
  305.      RGBEntry    = Record
  306.                     R,G,B : Byte;
  307.                    End;
  308.      PaletteType = Array[0..255] of RGBEntry;
  309.      RasterType  = Array[0..31] of Byte;
  310.  
  311. Const ActPage : Word = 0;         { Internal VideoPage - Always visible }
  312.       CurPage : Word = 0;         { User-Definable VideoPage            }
  313.       IsBusy  : Boolean = False;  { Busy-Flag, Internal use by Mouse    }
  314.  
  315.       PageOffset  : Array[0..4] Of Word = ($0000,$3E80,$7D00,$BB80,$FA00);
  316.       PageSegment : Array[0..4] Of Word = ($A000,$A3E8,$A7D0,$ABB8,$AFA0);
  317.  
  318.       MinX : Word = 0;      { Viewport coordinates:                    }
  319.       MinY : Word = 0;      { Default setting is view the whole screen }
  320.       MaxX : Word = 319;
  321.       MaxY : Word = 199;
  322.  
  323. Var Raster : Array[1..20] of RasterType; { User definable rasters }
  324.  
  325.  
  326. Procedure OpenGraphics;
  327. Procedure CloseGraphics;
  328. Procedure Sync;
  329.  
  330. Procedure SetPage(Pa:Word);
  331. Procedure ShowPage(Pa:Word);
  332. Procedure CopyPage(SourcePa,DestPa:Word);
  333. Procedure ClearPage(Pa:Word);
  334. Procedure FillPage(Pa:Word;Color:Byte);
  335. Procedure MoveBlock(X1,Y1,X2,Y2:Integer; SourcePa,DestPa:Word);
  336.  
  337. Procedure SetViewPort(X1,Y1,X2,Y2:Integer);
  338. Procedure FullPort;
  339.  
  340. Procedure Error(Message:String);
  341. Function  UpString(Str:String):String;
  342.  
  343. Procedure SwapInt(Var A,B:Integer);
  344. Procedure SwapWord(Var A,B:Word);
  345. Procedure SwapByte(Var A,B:Byte);
  346.  
  347. Function  LongMul(X,Y:Integer):LongInt;
  348. Function  LongDiv(X:LongInt; Y:Integer):Integer;
  349. Function  LongMod(X:LongInt; Y:Integer):Integer;
  350.  
  351. Procedure SetColor(Nr:Byte; Entry:RGBEntry);
  352. Procedure GetColor(Nr:Byte; Var Entry:RGBEntry);
  353. Procedure SetPalette(Var Palette);
  354. Procedure GetPalette(Var Palette);
  355.  
  356. Procedure SetWhitePal;
  357. Procedure SetBlackPal;
  358. Procedure SetColorPal(Color:Byte);
  359. (TGK_MAIN interface section; continued)
  360.  
  361.  
  362. Procedure FadeToWhite(Speed:Byte);
  363. Procedure FadeToBlack(Speed:Byte);
  364. Procedure FadeToColor(Color,Speed:Byte);
  365. Procedure FadeFromWhite(Speed:Byte);
  366. Procedure FadeFromBlack(Speed:Byte);
  367. Procedure FadeFromColor(Color,Speed:Byte);
  368.  
  369. Procedure Standard_Palette;            { Do not call! }
  370. 3.2 TGK_GP; Some graphics-primitives
  371.  
  372. Quite comprehensive, this one. In addition to all the basic
  373. graphics-primitives you can expect in a unit like this, such
  374. as putpixel, line, rectangle, circle, ellipse etc., you'll
  375. also find some more "exotic" features here. This unit also
  376. supports various fill-styles and rasters, special line-drawing
  377. modes such as brighter, dimmer and zero and fast polygon- and
  378. triangle-drawing procedures. Alas, the interface part:
  379.  
  380.  
  381. Type Direction    = (Up,Down,Left,Right);
  382.      TriangleType = Record
  383.                      X,Y : Array[1..3] of Integer;
  384.                   Col : Byte;
  385.                  End;
  386.  
  387. Const LineClipping : Boolean = False;
  388.  
  389.  
  390. Procedure PutPixel(X,Y:Integer; Color:Byte; Pa:Word);
  391. Function  GetPixel(X,Y:Integer; Pa:Word):Byte;
  392. Procedure XorPixel(X,Y:Integer; Pa:Word);
  393. Procedure ZeroPixel(X,Y:Integer; Color:Byte; Pa:Word);
  394. Procedure BrighterPixel(X,Y:Integer; Color,Pa:Word);
  395. Procedure DimmerPixel(X,Y:Integer; Color,Pa:Word);
  396.  
  397. Procedure Line(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  398. Procedure HLine(X1,Y1,X2:Integer; Color:Byte; Pa:Word);
  399. Procedure VLine(X1,Y1,Y2:Integer; Color:Byte; Pa:Word);
  400. Procedure XorLine(X1,Y1,X2,Y2:Integer; Pa:Word);
  401. Procedure ClipLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  402. Procedure BrighterLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  403. Procedure DimmerLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  404. Procedure ZeroLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  405.  
  406. Procedure Rectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  407. Procedure FRectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  408. Procedure XorRectangle(X1,Y1,X2,Y2:Integer; Pa:Word);
  409. Procedure Square(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
  410. Procedure FSquare(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
  411. Procedure XorSquare(X1,Y1,Size:Integer; Pa:Word);
  412.  
  413. Procedure Circle(X,Y,Radius:Integer; Color,Pa:Byte);
  414. Procedure FCircle(X,Y,Radius:Integer; Color,Pa:Byte);
  415. Procedure Ellipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
  416. Procedure FEllipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
  417.  
  418. Procedure Triangle(Triangle:TriangleType; Pa:Word);
  419. Procedure FTriangle(Triangle:TriangleType; Pa:Word);
  420. Procedure Poly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
  421. Procedure FPoly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
  422.  
  423. Procedure SetFillStyle(Style:Byte);
  424. Procedure SetUserFill(Nr:Byte; Var FillData);
  425. Procedure SetUserMask(Nr,OddMask,EvenMask:Byte);
  426. Procedure SetUserRaster(Nr:Byte; Var RasterData);
  427.  
  428. Function  Clip(Var X1,Y1,X2,Y2:Integer):Boolean;
  429. Procedure Paint(X,Y:Integer; Color:Byte; Pa:Word);
  430. Procedure PaintTo(X,Y:Integer; Color,BackColor:Byte; Pa:Word);
  431. Procedure SpLine(NrPoints:Word; Var CurveData; Color:Byte; Pa:Word);
  432.  
  433. Procedure SaveFillStyle(Var Style:Byte);
  434. Procedure RestoreFillStyle(Style:Byte);
  435.  
  436. Procedure ScrollPage(Page:Byte; Dir:Direction; Pixels,Color:Byte);
  437. 3.3 TGK_IO; User-interaction made easy
  438.  
  439. Here, we will find functions to give you complete control over
  440. the keyboard, mouse and joystick. Large 20x20 pixels multico-
  441. lor mouse-cursors are supported, for fun, mostly. There's
  442. really a wide range of features to be found here, just check
  443. it out. Keyboard-emulation for a mouse (for those users who
  444. are rodent-less) is implemented as well. It works as follows:
  445. use [Alt] plus one of the arrows on the keypad (including
  446. Home, End, PgUp and PgDn for diagonal movement) to move the
  447. mouse cursor around. Holding down [Shift] as well, makes the
  448. cursor move faster (10 pixels each step, instead of 1). For
  449. the mouse-buttons use [Alt] plus the minus [-] and plus [+] on
  450. the keypad, where minus is the left and plus the right button.
  451. There interface part of the unit looks somewhat like this:
  452.  
  453.  
  454. Type  JoyButtonType = (JoyLeftBut,JoyRightBut);
  455.       JoyPosType    = (XPosition,YPosition);
  456.       JoyDirection  = (LeftDir,RightDir,UpDir,DownDir,NoDir,
  457.                        UpLeftDir,UpRightDir,DownLeftDir,DownRightDir);
  458.  
  459.       MouseStruct   = Array[0..19,0..19] of Byte;
  460.       MouseSettingsType = Record
  461.                            X,Y         : Integer;
  462.                            MouseP      : Boolean;
  463.                            MinX,MinY,
  464.                            MaxX,MaxY   : Word;
  465.                            SMinX,SMinY,
  466.                            SMaxX,SMaxY : Word;
  467.                           End;
  468.  
  469. Const MouseX        : Integer = 160;
  470.       MouseY        : Integer = 100;
  471.       MousePointer  : Boolean = False;
  472.       DefaultCursor : MouseStruct = (...); { Not important }
  473.  
  474. Var MouseDriver   : Boolean;
  475.     NrOfButtons   : Byte;
  476.     KeyTable      : Array[1..127] of Boolean;
  477.  
  478.  
  479. Function  Keypressed : Boolean;
  480. Function  ReadKey : Char;
  481. Function  FunctionKey  : Boolean;
  482.  
  483. Function  CtrlPressed : Boolean;
  484. Function  AltPressed : Boolean;
  485. Function  ShiftPressed : Boolean;
  486. Function  LShiftPressed : Boolean;
  487. Function  RShiftPressed : Boolean;
  488.  
  489. Procedure DisableKeyboard;
  490. Procedure EnableKeyboard;
  491. Procedure ClearKeyBuffer;
  492.  
  493. Procedure InitMouse;
  494. Procedure MouseCursorOn;
  495. Procedure MouseCursorOff;
  496. Function  LeftButton : Boolean;
  497. Function  MiddleButton : Boolean;
  498. Function  RightButton : Boolean;
  499. Function  MouseMoved : Boolean;
  500. Function  MouseIn(X1,Y1,X2,Y2:Integer) : Boolean;
  501. Procedure SetMouse(X,Y:Integer);
  502. Procedure SetMouseRange(X1,Y1,X2,Y2:Word);
  503. Procedure FullMouseRange;
  504. Procedure SetSpecialRange(X1,Y1,X2,Y2:Integer);
  505. Procedure NoSpecialRange;
  506. (TGK_IO interface section; continued)
  507.  
  508.  
  509. Procedure SetMouseSensivity(HR,VR:Integer);
  510. Procedure GetMouseMotion(Var Horizontal,Vertical:Integer);
  511. Procedure GetMouseSettings(Var MouseInfo:MouseSettingsType);
  512. Procedure SetMouseSettings(MouseInfo:MouseSettingsType);
  513. Procedure SetMouseCursor(Shape:MouseStruct);
  514.  
  515. Function  UserActivity : Boolean;
  516.  
  517. Function  GamePort : Boolean;
  518. Function  GetJoyButton(JoyNr:Byte; Button:JoyButtonType) : Boolean;
  519. Function  GetJoyPosition(JoyNr:Byte; Axis:JoyPosType) : Integer;
  520. Function  GetJoyDirection(JoyNr:Byte) : JoyDirection;
  521. Function  JoystickExists(JoyNr:Byte) : Boolean;
  522. Procedure CalibrateJoystick(JoyNr:Byte);
  523. 3.4 TGK_BM; Bitmapping and the like
  524.  
  525. TGK_BM implements various bitmapping procedures. You can
  526. rotate bitmaps and scale them to any size, put them on screen
  527. in many different ways, such as brighter, dimmer, add or
  528. single-color. A mask page is supported as well, allowing
  529. sprites to be displayed on any one of 256 different layers. In
  530. my humble opinion, these procedures are pretty fast, allowing
  531. for really smooth programs. Here's the interface part:
  532.  
  533.  
  534. Type SpriteType = Record
  535.                    Sprite : Pointer; { Actual data }
  536.                    Size   : Word;    { Size of sprite in memory }
  537.                    ZPos   : Byte;    { Used with Mask-Screens }
  538.                   End;
  539.      WaveType   = Array[0..31] of Integer;
  540.  
  541. Procedure GetImage(X1,Y1,X2,Y2:Integer; Var Sprite:SpriteType; Pa:Word);
  542.  
  543. Procedure PutImage(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  544. Procedure PutBlock(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  545. Procedure PutScaled(X1,Y1:Integer; Centered:Boolean;
  546.                     Size:Word; Sprite:SpriteType; Pa:Word);
  547. Procedure PutRotated(X,Y,MoveX,MoveY:Integer;
  548.                      Angle:Word; Sprite:SpriteType; Pa:Word);
  549. Procedure PutImageBrighter(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  550. Procedure PutImageDimmer(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  551. Procedure PutImageAdd(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  552.  
  553. Procedure PutImageSC(X1,Y1:Integer; Color:Byte; 
  554.                      Sprite:SpriteType; Pa:Word);
  555. Procedure PutScaledSC(X1,Y1:Integer; Centered:Boolean; Color:Byte;
  556.                       Size:Word; Sprite:SpriteType; Pa:Word);
  557.  
  558. Procedure PutImageM(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  559. Procedure PutScaledM(X1,Y1:Integer; Centered:Boolean;
  560.                      Size:Word; Sprite:SpriteType; Pa:Word);
  561.  
  562. Procedure InitSprite(Var Sprite:SpriteType);
  563. Procedure DisposeSprite(Var Sprite:SpriteType);
  564.  
  565. Function SpriteWidth(Sprite:SpriteType; Size:Word):Word;
  566. Function SpriteHeight(Sprite:SpriteType; Size:Word):Word;
  567. Function PixelInSprite(X,Y:Word; Sprite:SpriteType):Boolean;
  568.  
  569. Procedure SetWave(Wave:WaveType);
  570. Procedure PutWave(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  571. Procedure PutWaveSC(X1,Y1:Integer; Color:Byte;
  572.                     Sprite:SpriteType; Pa:Word);
  573. 3.5 TGK_SND; For your listening pleasure
  574.  
  575. Using the TGK_SND unit you can add music and sound-effects to
  576. your programs. You can convert musical pieces from a wide
  577. range of existing files, namely the Adlib ROL-files, and have
  578. them play in the background while your program happily goes on
  579. doing other things. Samples can also be played, allowing for
  580. sound and speech effects. For music-playing, this unit sup-
  581. ports either an Adlib/Soundblaster card or the PC-Speaker
  582. (which sounds like crap) and for sample-playing it supports
  583. the Adlib, Soundblaster, PC-Speaker and Covox/DAC-Devices.
  584. Coming up, for your convenience, the interface part:
  585.  
  586.  
  587. Type SoundDevice = (Speaker,Adlib,SoundBlaster,Covox);
  588.      ModeType    = (Melodic,Percussive);
  589.      SampleType  = Record
  590.                     SignedSample,
  591.                     SampleStopped : Boolean;
  592.                     RepeatSample  : Integer;
  593.                     Sample        : Pointer;
  594.                     SampleLength,
  595.                     CurOffset     : Word;
  596.                     Loaded        : Boolean;
  597.                    End;
  598.      MusHdr      = Record
  599.                     ID                  : String[19];
  600.                     BasicTempo,TPB,Mode : Byte;
  601.                     NrIns,NrTEvents     : Word;
  602.                     NrNotes,NrIEvents,
  603.                     NrVEvents,
  604.                     NrPEvents,LastTick  : Array[1..11] of Word;
  605.                    End;
  606.      MusicType   = Record
  607.                     Header           : MusHdr;
  608.                     InsData,TEvents  : Pointer;
  609.                     NEvents,IEvents,
  610.                     VEvents,PEvents  : Array[1..11] of Pointer;
  611.                     CurTEvent        : Word;
  612.                     CurNote,CurDelay,
  613.                     CurIEvent,
  614.                     CurVEvent,
  615.                     CurPEvent        : Array[1..11] of Word;
  616.                     MusicTicks       : Word;
  617.                     NrVoices         : Byte;
  618.                     Tempo            : Word;
  619.                     Loaded           : Boolean;
  620.                     TotalTicks       : LongInt;
  621.                     LastTick         : Word;
  622.                     LongestVoice     : Byte;
  623.                     InterruptCounter : Word;
  624.                     RepeatMusic      : Integer;
  625.                    End;
  626.  
  627. Const AdlibInstalled : Boolean = False;       { Is there an Adlib?       }
  628.       SBInstalled    : Boolean = False;       { Is there a SoundBlaster? }
  629.       MusicDevice    : SoundDevice = Speaker; { Current MusicDevice      }
  630.       DACDevice      : SoundDevice = Speaker; { Current DACDevice        }
  631.       MusicPlaying   : Boolean = False;       { Music currently playing? }
  632.       GlobalVol      : Real = 1.0;            { Overall FM-Music volume  }
  633.  
  634. Var MusInfo : Record
  635.                Note        : Array[1..11] of Byte;
  636.                Volume      : Array[1..11] of Byte;
  637.                PitchBend   : Array[1..11] of Word;
  638.                PercentDone : Byte;
  639.               End;
  640.  
  641. (TGK_SND interface section; continued)
  642.  
  643.  
  644. { Routines for playing notes, setting the volume and instruments: }
  645. Procedure NoteOn(Note:Word; Voice:Byte);    { Play note on 'MusicDevice'  }
  646. Procedure NoteOff(Voice:Byte);              { Stop note on 'MusicDevice'  }
  647. Procedure SetMode(Mode:ModeType);           { Set Melodic/Percussive mode }
  648. Procedure SetOverallVolume(Vol:Real);       { Set Total Output-Level      }
  649. Procedure SetVolume(Voice:Byte; Vol:Real);  { Set Rel. Volume for a Voice }
  650. Procedure SetInstrument(Voice:Byte; Var Ins);{ Set Instrument for a Voice }
  651.  
  652. { FM-Music Playback Routines: }
  653. Procedure InitMusic(Var MusicData:MusicType);
  654. Procedure LoadMusic(Var MusicData:MusicType; FileName:String);
  655. Procedure SaveMusic(Var MusicData:MusicType; FileName:String);
  656. Procedure DisposeMusic(Var MusicData:MusicType);
  657. Procedure SetMusicDevice(Device:SoundDevice);
  658. Procedure StartMusic(Var MusicData:MusicType; Times:Byte);
  659. Procedure PauseMusic;
  660. Procedure StopMusic;
  661.  
  662. { Digital Sound Playback Routines: }
  663. Procedure InitSample(Var Sample:SampleType);
  664. Procedure LoadSample(Var Sample:SampleType;
  665.                      FileName:String; Signed:Boolean);
  666. Procedure DisposeSample(Var Sample:SampleType);
  667. Procedure StartSample(Var Sample:SampleType; Times:Byte);
  668. Procedure StopSample;
  669. Procedure SetSampleSpeed(Speed:Word);
  670. Procedure SetDACDevice(Device:SoundDevice);
  671. Procedure SetDigiVolume(Volume:Byte);
  672. Procedure SetDACPort(PortNr:Word);              { For the Covox, that is! }
  673.  
  674. { HiRes Timing Routines: }
  675. Procedure StartTimer(TimerNr:Byte);
  676. Function  TimerTicks(TimerNr:Byte):Word;
  677. Procedure WaitTimer(TimerNr:Byte; Ticks:Word; Reset:Boolean);
  678. 3.6 TGK_WIN; A graphical user interface (GUI)
  679.  
  680. If you want to create an easily understandable, good-looking
  681. menu structure, TGK_WIN is the unit for you. It provides you
  682. with moveable "MicroSoft Windows (TM)"-style windows. All
  683. sorts of buttons can be added to these windows and handling
  684. them is really easy. There are some predefined windows, such
  685. as a file-selection-window, which is always a tough one to
  686. implement. The colors and fillstyles can be changed to allow
  687. for your personal window-"look". Try it for fast results:
  688.  
  689.  
  690. Uses TGK_BM;
  691.  
  692. Const MaxButtons = 30;
  693.       Yes        = True;
  694.       No         = False;
  695.  
  696.       WDefault   = 0;
  697.       WCloseAble = 1;
  698.       WMoveAble  = 2;
  699.  
  700. Type WinBut     = (PushButton,CheckButton,StringButton,
  701.                    PullButton,HSlideButton,VSlideButton,NoButton);
  702.  
  703.      ButtonType = Record
  704.                    Style       : WinBut;
  705.                    X,Y,
  706.                    XSize,YSize : Word;
  707.                    Message     : String;
  708.                    State       : Boolean;
  709.                    MinValue,
  710.                    MaxValue,
  711.                    CurValue    : Integer;
  712.                   End;
  713.  
  714.      WindowColorSet = Record
  715.                        Line,BackGround,Button,
  716.                        Text,FillStyle,Bright,
  717.                        Dim,Bar,Finch,BarFill : Byte;
  718.                       End;
  719.  
  720.      WindowType = Record
  721.                    Open        : Boolean;
  722.                    StatusByte  : Byte;
  723.                    X,Y,
  724.                    XSize,YSize : Integer;
  725.                    Pa          : Word;
  726.                    SavedData   : SpriteType;
  727.                    WinSize     : Word;
  728.                    Title       : String;
  729.                    Buttons     : Array[1..MaxButtons] of ButtonType;
  730.                   End;
  731.  
  732. Procedure InitWindow(Var Window:WindowType;
  733.                          X,Y,XSize,YSize:Integer; Title:String);
  734. Procedure OpenWindow(Var Window:WindowType; Status:Byte; Pa:Word);
  735. Procedure RefreshWindow(Var Window:WindowType);
  736. Procedure CloseWindow(Var Window:WindowType);
  737. Function  HandleWindow(Var Window:WindowType):Word;
  738.  
  739. Function  StringWindow(X,Y,XSize,Pa:Word; Title,StartStr:String):String;
  740. Function  QuestionWindow(X,Y,Pa:Word; Question:String):Boolean;
  741. Function  FileWindow(X,Y,Pa:Word; Title,FileSpec:String):String;
  742. Procedure MessageWindow(X,Y,Pa:Word; Message:String);
  743.  
  744. (TGK_WIN interface section; continued)
  745.  
  746.  
  747. Procedure AddPushButton(Var Window:WindowType; Nr,X,Y:Word; 
  748.                             Message:String);
  749. Procedure AddCheckButton(Var Window:WindowType; Nr,X,Y:Word;
  750.                              Message:String; State:Boolean);
  751. Procedure AddHSlideButton(Var Window:WindowType;
  752.                               Nr,X,Y,XSize:Word;
  753.                               MinVal,MaxVal,CurVal:Integer);
  754. Procedure AddVSlideButton(Var Window:WindowType;
  755.                               Nr,X,Y,YSize:Word;
  756.                               MinVal,MaxVal,CurVal:Integer);
  757. Procedure AddStringButton(Var Window:WindowType;
  758.                               Nr,X,Y,XSize:Word; StartStr:String);
  759.  
  760. Function CheckButtonResult(Window:WindowType; Nr:Word):Boolean;
  761. Function SlideButtonResult(Window:WindowType; Nr:Word):Word;
  762. Function StringButtonResult(Window:WindowType; Nr:Word):String;
  763.  
  764. Procedure SetWindowColors(ColorSet:WindowColorSet);
  765. Procedure GetWindowColors(Var ColorSet:WindowColorSet);
  766. Procedure SetDefaultWindowColors;
  767. 3.7 TGK_3D; Vector graphics take off
  768.  
  769. If you are into making games like Elite, or making smooth
  770. looking demonstration programs, you will most definetely like
  771. this unit a good lot. It provides you with all the functions
  772. needed to do moving, rotating and resizing vector objects.
  773. The only part that is still up to you is creating the objects,
  774. which takes some imagination if you want them to look really
  775. original, I've come to realize lately...
  776.  
  777.  
  778. Type ClipType = (ClipNone,ClipLeft,ClipRight,ClipTop,ClipBottom);
  779.  
  780. Procedure InitObject(Nr:Word);
  781. Procedure DisposeObject(Nr:Word);
  782. Procedure DisposeAllObjects;
  783. Procedure SetOrigin(Nr:Word; X,Y:Integer);
  784. Procedure MoveOrigin(Nr:Word; X,Y:Integer);
  785. Procedure MoveObject(Nr:Word; X,Y,Z:Integer);
  786. Procedure SizeObject(Nr:Word;R:Real);
  787.  
  788. Procedure AddPoint(Nr:Word; X,Y,Z:Real);
  789. Procedure AddSurface3(Nr:Word; V1,V2,V3:Integer; Color,Style:Byte);
  790. Procedure AddSurface4(Nr:Word; V1,V2,V3,V4:Integer; Color,Style:Byte);
  791. Procedure AddSurface5(Nr:Word; V1,V2,V3,V4,V5:Integer; Color,Style:Byte);
  792.  
  793. Procedure RotateObject(Nr:Word; RX,RY,RZ:Integer);
  794. Procedure HideObject(Nr:Word);
  795. Procedure DrawObjectWireframe(Nr,Pa:Word);
  796. Procedure DrawObjectFilled(Nr,Pa:Word);
  797.  
  798. Procedure WireColor(Color:Byte);
  799. Function  ClipObject(Nr:Word; XMin,XMax,YMin,YMax:Integer) : ClipType;
  800. 3.8 TGK_TEXT; Get the message out!
  801.  
  802. The TGK_TEXT unit provides you with all the neccesary functi-
  803. ons to put text on screen. Text can be displayed in any size,
  804. along a vertical wave, etc. What more is there to be said,
  805. just try this unit and I am pretty sure you will like it:
  806.  
  807.  
  808. Const LeftText   = 0;
  809.       CenterText = 1;
  810.       RightText  = 2;
  811.       BottomText = 0;
  812.       TopText    = 2;
  813.  
  814. Type TextModeType = (Speed,Precision);
  815.      TextSettingsType = Record
  816.                          ActiveFont,Spacing : Byte;
  817.                          TextSize           : Word;
  818.                          Prop               : Boolean;
  819.                          Hjustify,VJustify  : Byte;
  820.                          TextMode           : TextModeType;
  821.                         End;
  822.  
  823.  
  824. Procedure Outtext(X,Y:integer; Color:Byte; Pa:Word; S:String);
  825. Procedure OuttextHLine(X,Y,YPos:Integer; Color:Byte; Pa:Word; S:String);
  826. Procedure OuttextVLine(X,Y,XPos:Integer; Color:Byte; Pa:Word; S:String);
  827. Procedure OuttextWave(X,Y:Integer; Color:Byte; Pa:Word; S:String);
  828. Function  StringWidth(S:String) : Word;
  829.  
  830. Procedure LoadFont(Name:String; Nr:Byte);
  831. Procedure SetFont(Nr:Byte);
  832. Procedure DisposeFont(Nr:Byte);
  833. Procedure DisposeAllFonts;
  834.  
  835. Procedure SetTextSize(Size:Word);
  836. Procedure SetTextJustify(Horizontal,Vertical:Byte);
  837. Procedure SetSpacing(Space:Byte);
  838. Procedure SetProportional(Proportional:Boolean);
  839. Procedure SetTextMode(Mode:TextModeType);
  840.  
  841. Procedure GetTextSettings(Var Settings:TextSettingsType);
  842. Procedure SetTextSettings(Settings:TextSettingsType);
  843. Procedure DefaultTextSettings;
  844. 3.9 TGK_ANIM; Look mom, it's moving...
  845.  
  846. The TGK_ANIM unit allows you to add animations to your pro-
  847. grams. These can be created using the ANIMEDIT program. Lots
  848. of options can be specified for each animation, allowing for
  849. very complex animation movement and behaviour without any need
  850. for the program to update animation parameters whatsoever.
  851. Just one routine, HandleAnimation, does the job. Of course, if
  852. you plan on doing special stuff with animations, you can
  853. always control them more directly.
  854. This unit allows for what I call "Animation-Cloning", saving a
  855. lot of memory. When you clone an animation you put all of it's
  856. parameters in another animation, but not the actual picture
  857. data. The cloned animation still uses the picture data from
  858. the original animation, requiring only a few bytes of memory.
  859.  
  860.  
  861. Type AnimMode = (AnimStatic,AnimMove,AnimRandom,AnimPath,AnimInactive);
  862.  
  863.      AnimSpec = (AnimXStep,AnimYStep,AnimSpeed,AnimZPos,
  864.                  AnimDir,AnimPong,AnimChance);
  865.  
  866.      FrameRec = Array[1..50] of Record
  867.                                  Bitmap      : Pointer; { Actual data    }
  868.                                  BMSize      : Word;    { size of data   }
  869.                                  X,Y         : Integer; { (X,Y)-offset   }
  870.                                  XSize,YSize : Word;    { and (X,Y)-size }
  871.                                 End;
  872.  
  873.      PathType = Record
  874.                  Path     : Pointer;   { Actual Data       }
  875.                  NrPoints : Word;      { Number of Entries }
  876.                  CurPoint : Word;      { and current entry }
  877.                 End;
  878.  
  879.      AnimType = Record
  880.                  Loaded    : Boolean;  { Animation Loaded ?           }
  881.                  Cloned    : Boolean;  { Animation has been cloned?   }
  882.                  Frame     : ^FrameRec;{ Pointer to frame-data        }
  883.                  Range     : Record
  884.                               StartX,  { Movement area for this       }
  885.                               StartY,  { animation...                 }
  886.                               EndX,
  887.                               EndY    : Integer;
  888.                              End;
  889.                  CurFrame  : Byte;     { Current Frame                }
  890.                  NrFrames  : Byte;     { Nr. of Frames in animation   }
  891.                  Speed,                { Animation Speed              }
  892.                  SpeedIdx  : Word;     { and Speed-Index              }
  893.                  Mode      : AnimMode; { Current animation mode       }
  894.                  Path      : PathType; { The animation path, if any   }
  895.                  X,Y       : Integer;  { (X,Y)-Pos on Screen          }
  896.                  XStep,
  897.                  YStep     : ShortInt; { X- and Y-Axis Movement-speed }
  898.                  ZPos      : Byte;     { ZPos for Mask-Page           }
  899.                  PingPong  : Boolean;  { Does this one bounce?        }
  900.                  CountUp   : Boolean;  { Going up or down...          }
  901.                  MaxX,MaxY : Word;     { Largest frame-size           }
  902.                  Chance    : Word;     { Chance of handling...        }
  903.                  InChance  : Boolean;  { Currently in a "Chance"?     }
  904.                End;
  905.  
  906. Const UseMask : Boolean = False;       { Use the Mask-Page for anims? }
  907. (TGK_ANIM interface section; continued)
  908.  
  909.  
  910. Procedure InitAnimation(Var Animation:AnimType);
  911. Procedure DisposeAnimation(Var Animation:AnimType);
  912.  
  913. Procedure LoadAnimation(Var Animation:AnimType; FileName:String);
  914. Procedure CloneAnimation(Var SourceAnim,DestAnim:AnimType);
  915.  
  916. Procedure SetupAnimation(Var Animation:AnimType; 
  917.                          X,Y:Integer; Mode:AnimMode);
  918. Procedure AnimationSpecs(Var Animation:AnimType; 
  919.                          Spec:AnimSpec; Value:Integer);
  920. Procedure HandleAnimation(Var Animation:AnimType; Pa:Word);
  921.  
  922. Procedure LoadPath(Var Animation:AnimType; FileName:String);
  923. 3.10 TGK_FILE; File Handling routines
  924.  
  925. Various file handling routines. Loads many different picture
  926. formats, stores files in resources etc. Interface:
  927.  
  928.  
  929. Uses Tgk_BM;
  930.  
  931. Const Resource : String = ''; { Default is no resource, change at will  }
  932.  
  933. Type PalUpdates = (None,Replace,Remap);
  934.  
  935.  
  936. Procedure NewResource;
  937. Procedure AddToResource(FileName:String);
  938.  
  939. Function PackData(Var DataIn,DataOut; NrIn:Word; Var NrOut:Word):Boolean;
  940. Function UnpackData(Var DataIn,DataOut; NrIn:Word; Var NrOut:Word):Boolean;
  941.  
  942. Procedure LoadGPF(FileName:String; Pa:Word);
  943. Procedure SaveGPF(FileName:String; Pa:Word);
  944.  
  945. Procedure LoadGIF(FileName:String; Pa:Word);
  946. Procedure LoadBMP(FileName:String; Pa:Word);
  947. Procedure LoadLBM(FileName:String; Pa:Word);
  948. Procedure LoadPCX(FileName:String; Pa:Word);
  949.  
  950. Procedure LoadImage(FileName:String; Var Sprite:SpriteType);
  951. Procedure SaveImage(FileName:String; Sprite:SpriteType);
  952. Procedure LoadBBM(FileName:String; Var Sprite:SpriteType);
  953.  
  954. Function  InitFile(Var FileHandle:File; FileName:String;
  955.                    Var FSize:LongInt):Boolean;
  956. Function  Exist(FileName:String):Boolean;
  957. Function  GoodName(FileName:String):String;
  958.  
  959. Function  Extension(FileName:String):String;
  960. Procedure DefaultExtension(Var FileName:String; Extension:String);
  961. Procedure NewExtension(Var FileName:String; Extension:String);
  962.  
  963. Procedure SetPalUpdate(Update:PalUpDates);
  964. Procedure SetLoadOffset(X,Y:Word);
  965. Chapter 4: Utility programs
  966.  
  967.  
  968. 4.1 GAMECAP; A screen-capture program
  969.  
  970. GAMECAP is a small utility allowing you to "steal" pictures
  971. from other programs. Once installed, it will wait until you
  972. press the hot-key and [Plop!], it sort of "pops up", saving
  973. the picture on screen in a GPF-file, a Game Picture-File,
  974. allowing you to use it in your own programs. GAMECAP will
  975. automatically compress your picture, saving quite a large
  976. amount of diskspace in most cases. GAMECAP will capture 
  977. screens from any 320x200x256 mode, be it the standard BIOS-
  978. Mode (13h) or the tweaked X-Mode.
  979.  
  980.  
  981. 4.2 ANIMEDIT; A full-featured animation editor
  982.  
  983. Using ANIMEDIT you can create your own animations from series
  984. of frames you've drawn. ANIMEDIT takes the name of a picture-
  985. file you want to use to capture the frames from as an optional
  986. parameter. This file can be in any format G∙A∙M∙E recognizes
  987. and if it is not specified, ANIMEDIT assumes you only want to
  988. have a look at an existing animation. The program is pretty
  989. self-explanatory and is fully controlled using a mouse, which
  990. should make it really easy to use. However, there are a few
  991. things worth mentioning here, I guess. First of all, a new
  992. animation frame is simply "grabbed" from the loaded picture by
  993. holding down the left mouse-cursor and creating a box around
  994. the area of interest. After releasing the left button, 
  995. ANIMEDIT will automatically present you with it's animation-
  996. menu. Now you can align the frame you've just grabbed in the
  997. "animation-box" and click the left mouse button to put it
  998. down. It will then be displayed in the "animation-box", in the
  999. background. You can move over it again and put it down a few
  1000. pixels to the left this time, or you could click on the close-
  1001. window button (upper-left corner of the animation-menu) and
  1002. grab a new frame from the background picture. 
  1003. You will notice that there are two slide-bars at the lower and
  1004. right side of the "animation-box". The one on the lower side
  1005. is used to select the current frame and the one on the right
  1006. to set the animation-speed. In addition to this, please note
  1007. the two check buttons on the lower right side of the window.
  1008. These are used to set the animation-direction and whether the
  1009. animation will restart with frame one after it has reached the
  1010. final frame or it will start counting down from that time on.
  1011. Just fiddle around with them, you'll see what I mean.
  1012. Once you're finished, you can save your animation for later
  1013. use. I know all this might sound quite complicated right now
  1014. but it really isn't; I'm just not sure on how to explain this
  1015. to you clearly. Anyway, I've implemented a clear-animation
  1016. button as well, for those times when you really screw up
  1017. things ;-)
  1018. 4.3 ROL2GMF; A music-conversion program
  1019.  
  1020. This program is used to convert music-files from the Adlib
  1021. ROL-format to the much more versatile GMF-format, which is
  1022. short for Game Music File. Instruments will no longer be in 
  1023. seperate files, as with the ROL-format and you'll see a 
  1024. significant decrease in filesize, usually about 40%. The
  1025. program supports wildcars, allowing to convert large collecti-
  1026. ons of music-files all in one go. Please note however, that
  1027. due to a strange bug, the music-files need to be in the same
  1028. direction as the conversion program when using wildcards to
  1029. specify multiple files. When only converting one file, this
  1030. error doesn't seem to occur 8'(
  1031.  
  1032.  
  1033. 4.4 GAMEFONT; A font-conversion program
  1034.  
  1035. With GAMEFONT you can convert fonts to the GFF-format, short
  1036. for Game Font File. Currently supported formats are the CRD-
  1037. format, as used by THG (The Humble Guys) in their program
  1038. MEGAFONT, which comes with Intro Maker 3.0 and the FNT-format
  1039. as used by PC-Magazine's FontEdit. The latter is also used by
  1040. Kai Rohrbacher's ANIVGA-toolkit, which comes packed with a lot
  1041. of these fonts. 
  1042. Upon startup, the program will first ask you to specify the
  1043. fonttype to be converted. If you pick FontEdit, you will only
  1044. have to supply GAMEFONT with the name (and optionally path) of
  1045. the source-fontfile. No further options are in effect. If you
  1046. choose THG-Fonts, however, you will first have to tell GAME-
  1047. FONT what type of graphicsfile to use for the source-fontfile.
  1048. You can choose from GIF, PCX and LBM. Now GAMEFONT will ask
  1049. you for the name of this graphicsfile and it's accompanying
  1050. coordinatefile (.CRD). Thus, if your font was in the file
  1051. FONT.GIF, the coordinatefile would have to be named FONT.CRD.
  1052. Finally, GAMEFONT will ask whether or not you want palette-
  1053. remapping applied. If you answer yes, each color in the font-
  1054. file will be replaced with the closest matching color from the
  1055. standard G∙A∙M∙E-palette, which is in fact the standard DeLuxe
  1056. Paint ][ Enhanced palette.
  1057.  
  1058.  
  1059. 4.5 MAKERES; A resource-file creator
  1060.  
  1061. MAKERES is a very simple program ("as is"), allowing you to
  1062. store different datafiles in a single resourcefile. If you
  1063. specify a resourcefile in one of your programs, the program
  1064. will automatically search for any data it needs in this re-
  1065. sourcefile. If not found, it will still try to use external
  1066. data. When run, MAKERES first of all prompts your for the name
  1067. of a resourcefile. If this file already exists, you can choose
  1068. to either replace it or append data to it. Now MAKERES will
  1069. continue asking for names of files to add to the resource
  1070. until you enter a blank line. 
  1071. As for now, functions such as removing files from resources or
  1072. replacing files in resources are NOT supported. This is sub-
  1073. ject to change in future versions of G∙A∙M∙E however, as
  1074. MAKERES is bound to be improved a lot in the future.
  1075. Chapter 5: G∙A∙M∙E reference manual
  1076.  
  1077.  
  1078. ActPage (Variable; do not modify)                     TGK_MAIN
  1079. ──────────────────────────────────────────────────────────────
  1080.   ActPage : Word;
  1081.  
  1082. This variable always contains the number of the visible page
  1083. in videomemory. It may come in handy when you have a procedure
  1084. that writes to video-memory, but you do not know in advance
  1085. which page you will be writing to. A good example of this is
  1086. the G∙A∙M∙E mouse-driver which always needs to draw the cursor
  1087. on the visible page, but doesn't have any knowledge of what
  1088. page the user will be using at a certain moment.
  1089.  
  1090.  
  1091. AddCheckButton (Procedure)                             TGK_WIN
  1092. ──────────────────────────────────────────────────────────────
  1093.   AddCheckButton(Var Window:WindowType; Nr,X,Y:Word; 
  1094.                  Message:String; State:Boolean);
  1095.  
  1096. Adds checkbutton number [Nr] at position (X,Y) to the window
  1097. [Window]. [Message] is the text that will be displayed next to
  1098. the button and [State] reflects the initial state of the
  1099. button. [Nr] must be in the range 1..MaxButtons and [Window]
  1100. must be a window that has been previously initialized through
  1101. a call to InitWindow.
  1102.  
  1103.  
  1104. AddHSlideButton (Procedure)                            TGK_WIN
  1105. ──────────────────────────────────────────────────────────────
  1106.   AddHSlideButton(Var Window:WindowType; Nr,X,Y,XSize:Word; 
  1107.                   MinVal,MaxVal,CurVal:Integer);
  1108.  
  1109. Adds horizontal slidebutton number [Nr] at position (X,Y) to
  1110. the window [Window]. [XSize] is the horizontal size in pixels
  1111. of this button. [MinVal] and [MaxVal] are the lower and upper
  1112. limits for the button and [CurVal] contains the initial value.
  1113. [CurVal] must be in the range [MinVal]..[MaxVal], [Nr] must be
  1114. in the range 1..MaxButtons and [Window] must be a window that
  1115. has been previously initialized through a call to InitWindow.
  1116.  
  1117.  
  1118. AddPoint (Procedure)                                    TGK_3D
  1119. ──────────────────────────────────────────────────────────────
  1120.   AddPoint(Nr:Word; X,Y,Z:Real);
  1121.  
  1122. Adds a new point to vector-object [Nr] with the coordinates
  1123. (X,Y,Z). Object [Nr] must have been previously initalized and 
  1124. no more than 200 points can be defined per object. Each point
  1125. added will have a value one higher than the last point, star-
  1126. ting with 1. Thus, the first point added will be 1, the second
  1127. added will be 2, etc. Here's an example:
  1128.  
  1129.  InitObject(1);
  1130.  AddPoint(1,10,10,10);     { 1 }
  1131.  AddPoint(1,-10,-10,10);   { 2 }
  1132.  AddPoint(1,10,-10,10);    { 3 }
  1133.  AddSurface3(1,1,2,3,7,0); { Triangle, solid-gray-fill }
  1134.  
  1135.  
  1136. AddPushButton (Procedure)                              TGK_WIN
  1137. ──────────────────────────────────────────────────────────────
  1138.   AddPushButton(Var Window:WindowType; Nr,X,Y:Word; 
  1139.                 Message:String);
  1140.  
  1141. Adds pushbutton number [Nr] at position (X,Y) to the window
  1142. [Window]. [Message] is the text that will be displayed on the
  1143. button. [Nr] must be in the range 1..MaxButtons and [Window]
  1144. must be a window that has been previously initialized through
  1145. a call to InitWindow.
  1146.  
  1147.  
  1148. AddStringButton (Procedure)                            TGK_WIN
  1149. ──────────────────────────────────────────────────────────────
  1150.   AddStringButton(Var Window:WindowType; Nr,X,Y,XSize:Word;
  1151.                   StartStr:String);
  1152.  
  1153. Adds stringbutton number [Nr] at position (X,Y) to the window
  1154. [Window]. The button will have a horizontal size in pixels of
  1155. [XSize]. [StartStr] contains the initial string value for the
  1156. button. [Nr] must be in the range 1..MaxButtons and [Window]
  1157. must be a window that has been previously initialized through
  1158. a call to InitWindow.
  1159.  
  1160.  
  1161. AddVSlideButton (Procedure)                            TGK_WIN
  1162. ──────────────────────────────────────────────────────────────
  1163.   AddVSlideButton(Var Window:WindowType; Nr,X,Y,YSize:Word; 
  1164.                   MinVal,MaxVal,CurVal:Integer);
  1165.  
  1166. Adds vertical slidebutton number [Nr] at position (X,Y) to the
  1167. window [Window]. [XSize] is the vertical size in pixels of
  1168. this button. [MinVal] and [MaxVal] are the lower and upper
  1169. limits for the button and [CurVal] contains the initial value.
  1170. [CurVal] must be in the range [MinVal]..[MaxVal], [Nr] must be
  1171. in the range 1..MaxButtons and [Window] must be a window that
  1172. has been previously initialized through a call to InitWindow.
  1173.  
  1174.  
  1175. AddSurface3 (Procedure)                                 TGK_3D
  1176. ──────────────────────────────────────────────────────────────
  1177.   AddSurface3(Nr:Word; V1,V2,V3:Integer; Color,Style:Byte);
  1178.  
  1179. Adds a surface with 3 vertices (triangular) to vector-object
  1180. [Nr]. [V1], [V2] and [V3] specify the 3 corners for this
  1181. surface, corresponding to the points specified with AddPoint.
  1182. [Color] is the color that will be used when drawing this
  1183. surface and [Style] corresponds to one of the styles listed
  1184. under setfillstyle.
  1185.  
  1186.  
  1187. AddSurface4 (Procedure)                                 TGK_3D
  1188. ──────────────────────────────────────────────────────────────
  1189.   AddSurface4(Nr:Word; V1,V2,V3,V4:Integer; Color,Style:Byte);
  1190.  
  1191. Adds a surface with 4 vertices (quadrangular) to vector-object
  1192. [Nr]. [V1], [V2], [V3] and [V4] specify the 4 corners for this
  1193. surface, corresponding to the points specified with AddPoint.
  1194. [Color] is the color that will be used when drawing this
  1195. surface and [Style] corresponds to one of the styles listed
  1196. under setfillstyle.
  1197.  
  1198.  
  1199. AddSurface5 (Procedure)                                 TGK_3D
  1200. ──────────────────────────────────────────────────────────────
  1201.   AddSurface5(Nr:Word; V1,V2,V3,V4,V5:Integer; 
  1202.               Color,Style:Byte);
  1203.  
  1204. Adds a surface with 5 vertices (pentagonal) to vector-object
  1205. [Nr]. [V1], [V2], [V3], [V4] and [V5] specify the 5 corners
  1206. for this surface, corresponding to the points specified with
  1207. AddPoint. [Color] is the color that will be used when drawing
  1208. this surface and [Style] corresponds to one of the styles
  1209. listed under setfillstyle.
  1210.  
  1211.  
  1212. AddToResource (Procedure)                             TGK_FILE
  1213. ──────────────────────────────────────────────────────────────
  1214.   AddToResource(FileName:String);
  1215.  
  1216. Add the file referred to by [FileName] to the (existing) re-
  1217. source file as specified with the [Resource] variable. Does
  1218. not check to see whether the file already exists in the re-
  1219. source-file, but if this is so, it's of no use adding the file
  1220. to the resource, because the previously added file with the
  1221. same name will always be found first. In other words, existing
  1222. files in a resource cannot be updated. There's really not much
  1223. point in using this procedure, unless you would like to create
  1224. your own resource-file maker, such as MAKERES. 
  1225.  
  1226.  
  1227. AdlibInstalled (Const)                                 TGK_SND
  1228. ──────────────────────────────────────────────────────────────
  1229.   AdlibInstalled : Boolean;
  1230.  
  1231. [AdlibInstalled] will be set to true if an Adlib-Compatible
  1232. soundcard was found in your system. Otherwise, it will be set
  1233. to false.
  1234.  
  1235.  
  1236. AltPressed (Function)                                   TGK_IO
  1237. ──────────────────────────────────────────────────────────────
  1238.   AltPressed : Boolean;
  1239.  
  1240. Returns true if the Alt-Key is currently being pressed.
  1241.  
  1242.  
  1243. AnimationSpecs (Procedure)                            TGK_ANIM
  1244. ──────────────────────────────────────────────────────────────
  1245.   AnimationSpecs(Var Animation:AnimType;
  1246.                  Spec:AnimSpec; Value:Integer);
  1247.  
  1248. Sets the specification [Spec] for the animation [Animation] to
  1249. the value [Value]. For a complete list of all available anima-
  1250. tion specifications, look at AnimSpec.
  1251.  
  1252.  
  1253. AnimMode (Type)                                       TGK_ANIM
  1254. ──────────────────────────────────────────────────────────────
  1255.   AnimMode = (AnimStatic, AnimMove, AnimRandom,
  1256.               AnimPath, AnimInactive);
  1257.  
  1258. This type is used in conjunction with SetupAnimation to speci-
  1259. fy in what manner an animation will behave. The different
  1260. modes are as follows:
  1261.  
  1262.   · AnimStatic      Animation does not move on either X- or Y- 
  1263.                     axis. An example of it's use could be that
  1264.                     of a house with a burning fire inside,     
  1265.                     which we can see flickering through the
  1266.                     window. All the frames will be displayed
  1267.                     at the same (X,Y)-coordinates.
  1268.  
  1269.   · AnimMove        Animation moves along the X- and/or Y-axis
  1270.                     at a speed determined by the AnimXStep and
  1271.                     AnimYStep variables which are defined
  1272.                     using AnimationSpecs. Could be used with,
  1273.                     for example, a sleigh sliding by.
  1274.  
  1275.   · AnimRandom      Animation moves along the X- and Y-Axis at
  1276.                     random at a maximum speed determined by
  1277.                     the AnimXStep and AnimYStep variables
  1278.                     which are defined using AnimationSpecs.
  1279.  
  1280.   · AnimPath        Animation moves along a given path. This
  1281.                     path needs to be loaded from a separate 
  1282.                     file, using LoadPath. Nice if you want
  1283.                     your animation to move about in a very
  1284.                     special way, which is not easy to describe
  1285.                     using a simple formula.
  1286.  
  1287.   · AnimInactive    Animation will not be displayed when a
  1288.                     call to HandleAnimation is made. Used to
  1289.                     temporarily turn of certain animations.
  1290.  
  1291.  
  1292. AnimSpec (Type)                                       TGK_ANIM
  1293. ──────────────────────────────────────────────────────────────
  1294.   AnimSpec = (AnimXStep, AnimYStep, AnimSpeed, AnimZPos,
  1295.               AnimDir, AnimPong, AnimChance);
  1296.  
  1297. This type is used in conjunction with AnimationSpecs to speci-
  1298. fy what animation-specification to change. Here's what the
  1299. various options stand for:
  1300.  
  1301.   · AnimXStep       Sets the movement speed along the X-axis.
  1302.                     Should be in the range [-127,127], with
  1303.                     the unit being pixels.
  1304.  
  1305.   · AnimYStep       Sets the movement speed along the Y-axis.
  1306.                     Should be in the range [-127,127], with
  1307.                     the unit being pixels.
  1308.  
  1309.   · AnimSpeed       Sets the animation speed. The higher the
  1310.                     value, the lower the speed, a new frame
  1311.                     will become active each [AnimSpeed] calls.
  1312.  
  1313.   · AnimZPos        Sets the Z-position for use with the mask
  1314.                     screen. For more information on how the
  1315.                     mask screen works, have a look at Sprite-
  1316.                     Type and PutImageSC. To have HandleAnima-
  1317.                     tion actually use the mask screem, make
  1318.                     sure you set the UseMask variable to true.
  1319.  
  1320.   · AnimDir         Sets the direction in which the frames
  1321.                     will be played. False is from high to low
  1322.                     (1 to NrFrames) and true from low to high
  1323.                     (NrFrames downto 1).
  1324.  
  1325.   · AnimPong        Specifies whether animations "wrap-around"
  1326.                     or "bounce". When set to false, frame 1
  1327.                     will be displayed after the last frame has
  1328.                     been displayed (or the last frame will be
  1329.                     displayed after frame 1 has been display-
  1330.                     ed, depending on the current setting of
  1331.                     [AnimDir]). When set to true, the animati-
  1332.                     on will first count from frame 1 to the
  1333.                     last frame, then back to frame 1 and than
  1334.                     back to the last frame again, etc (or
  1335.                     vice-versa, depending on the current set-
  1336.                     ting of [AnimDir]).
  1337.  
  1338.   · AnimChance      Sets the relative chance for an animation
  1339.                     to actually be played. Suppose you set
  1340.                     this to 20. This will give you a 1 out of
  1341.                     20 chance that the animation will be play-
  1342.                     ed. If this "1 out of 20" occurs, the
  1343.                     animation will be played for one full
  1344.                     round, that is, all frames will be dis-
  1345.                     played once (or twice if [AnimPong] is set
  1346.                     to true). After that, another "1 out of
  1347.                     20" has to occur to start it again.
  1348.  
  1349.  
  1350. AnimType (Type)                                       TGK_ANIM
  1351. ──────────────────────────────────────────────────────────────
  1352.   AnimType = Record
  1353.               [This is a very complicated record. 
  1354.                Therefore, only the entries of interest
  1355.                to the user will be displayed here...]
  1356.               Frame     : ^FrameRec
  1357.               Range     :  Record
  1358.                            StartX,StartY,EndX,EndY : Integer;
  1359.                           End;
  1360.               CurFrame  : Byte;
  1361.               NrFrames  : Byte;
  1362.               Path      : PathType;
  1363.               Mode      : AnimMode;
  1364.               X,Y       : Integer;
  1365.               MaxX,MaxY : Word;
  1366.              End;
  1367.  
  1368. The type [AnimType] is a general type used for all animations.
  1369. [Frame] is a pointer to an array of frame-descriptions, as
  1370. discussed under FrameRec. [Range] is a sub-record which may be
  1371. used to set sort of a viewport for the animation. If you would
  1372. set [Range.StartX] to 100 and your sprite would be moving from
  1373. the right edge of the screen to the left, using the AnimMove
  1374. mode, it would wrap around at 100-[MaxX] and thus be displayed
  1375. at the right edge of the screen again. Just fiddle around with
  1376. it. [CurFrame] denotes the current frame for this animation,
  1377. whereas [NrFrames] contains the number of frames it consists
  1378. of. [Path] is a pointer to a path-structure, as discussed
  1379. under PathType. [Mode] reflects the animation-mode as discus-
  1380. sed under AnimMode. [X] and [Y] are the current (X,Y)-coordi-
  1381. nates on screen, for this animation. [MaxX] and [MaxY] are the
  1382. respective X- and Y-size in pixels of the largest frame found
  1383. in the animation. They are used in conjunction with [Range];
  1384. as discussed above.
  1385.  
  1386.  
  1387. BottomText (Const)                                    TGK_TEXT
  1388. ──────────────────────────────────────────────────────────────
  1389.   BottomText = 0;
  1390.  
  1391. Used in conjunction with SetTextJustify, for more information
  1392. on how this procedure works, have a look under the appropriate
  1393. header.
  1394.  
  1395.  
  1396. BrighterLine (Procedure)                                TGK_GP
  1397. ──────────────────────────────────────────────────────────────
  1398.   BrighterLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  1399.  
  1400. Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], giving it a
  1401. "brighter" appeal. This will only work correctly when using
  1402. the default G∙A∙M∙E color-palette. [Color] specifies the color
  1403. to be used when underlying pixels have a value of zero. Use
  1404. DimmerLine as a contrastive procedure. Will either clip to the
  1405. current viewport boundaries or not, depending on the setting
  1406. of LineClipping.
  1407.  
  1408.  
  1409. BrighterPixel (Procedure)                               TGK_GP
  1410. ──────────────────────────────────────────────────────────────
  1411.   BrighterPixel(X,Y:Integer; Color:Byte; Pa:Word);
  1412.  
  1413. Gives the pixel at position (X,Y) on page [Pa] a "brighter"
  1414. appeal. This will only work correctly when using the default
  1415. G∙A∙M∙E color-palette. [Color] specifies the color to be used
  1416. when the underlying pixel has a value of zero. Use Dimmerpixel
  1417. as a contrastive procedure. Will clip to the current viewport
  1418. boundaries.
  1419.  
  1420.  
  1421. ButtonType (Type)                                      TGK_WIN
  1422. ──────────────────────────────────────────────────────────────
  1423.   ButtonType = Record
  1424.                 { Loads-o-junk... }
  1425.                 XSize,YSize : Word;
  1426.                End;
  1427.  
  1428. This type is used as a subtype for WindowType to describe one
  1429. button in a window. The only fields of interest are XSize and 
  1430. YSize which will allow the user to create "custom-sized"
  1431. buttons by changing their value AFTER the button has been
  1432. created using one of the AddButton functions. Example:
  1433.  
  1434.  Var MyWin : WindowType;
  1435.  
  1436.  InitWindow(MyWin,10,10,200,100,'Hi I am "Pizza" Femke!');
  1437.  AddPushButton(MyWin,1,20,20,'Let''s do Quattro Stagione');
  1438.  MyWin.Buttons[1].XSize:=150; { Make long button... }
  1439.  OpenWindow(MyWin,WCloseAble,0);
  1440.   Repeat
  1441.   Until HandleWindow(MyWin)=0;
  1442.  CloseWindow(MyWin);
  1443.  
  1444.  
  1445. CalibrateJoystick (Procedure)                           TGK_IO
  1446. ──────────────────────────────────────────────────────────────
  1447.   CalibrateJoystick(JoyNr:Byte);
  1448.  
  1449. Calibrates the joystick in port [JoyNr] for use with G∙A∙M∙E.
  1450. First waits for the user to move the joystick to it's upper-
  1451. left corner and press the left-button. Then waits for the user
  1452. to move it to the lower-right corner and press the right
  1453. button. Does not display ANY messages on screen, you will have
  1454. to account for that yourself. This was done to allow for total
  1455. "designing-freedom" on the programmers side.
  1456.  
  1457.  
  1458. CenterText (Const)                                    TGK_TEXT
  1459. ──────────────────────────────────────────────────────────────
  1460.   CenterText = 1;
  1461.  
  1462. Used in conjunction with SetTextJustify, for more information
  1463. on how this procedure works, have a look under the appropriate
  1464. header.
  1465.  
  1466.  
  1467. CheckButtonResult (Function)                           TGK_WIN
  1468. ──────────────────────────────────────────────────────────────
  1469.   CheckButtonResult(Window:WindowType; Nr:Word):Boolean;
  1470.  
  1471. A call to this procedure reflects the current state of a
  1472. button of type checkbutton, specified as button number [Nr]
  1473. for window [Window]. Example:
  1474.  
  1475.  Var SoundWin      : WindowType;
  1476.      Effects,Score : Boolean;
  1477.      WinResult     : Word;
  1478.  
  1479.  InitWindow(SoundWin,10,10,150,100,'Sound selection:');
  1480.  AddCheckButton(SoundWin,1,20,20,'Sound Effects',True);
  1481.  AddCheckButton(SoundWin,2,20,40,'Musical Score',False);
  1482.  AddPushButton(SoundWin,3,20,60,'All done...');
  1483.  OpenWindow(SoundWin,WMoveable,0);
  1484.   Repeat
  1485.    WinResult:=HandleWindow(SoundWin);
  1486.     If WinResult=1 then
  1487.      Effects:=CheckButtonResult(SoundWin,1) else
  1488.     If WinResult=2 then
  1489.      Score:=CheckButtonResult(SoundWin,2);
  1490.   Until WinResult=3; { All Done... }
  1491.  CloseWindow(SoundWin);
  1492.  
  1493.  
  1494. Circle (Procedure)                                      TGK_GP
  1495. ──────────────────────────────────────────────────────────────
  1496.   Circle(X,Y,Radius:Integer; Color,Pa:Byte);
  1497.  
  1498. Draws a circle on page [Pa], using color [Color]. The circle
  1499. will be centered at (X,Y) and have a radius of [Radius] 
  1500. pixels. Will clip to the current viewport.
  1501.  
  1502.  
  1503. ClearKeyBuffer (Procedure)                              TGK_IO
  1504. ──────────────────────────────────────────────────────────────
  1505.  
  1506. Removes all waiting keypresses from the keyboardbuffer.
  1507.  
  1508.  
  1509. ClearPage (Procedure)                                 TGK_MAIN
  1510. ──────────────────────────────────────────────────────────────
  1511.   ClearPage(Pa:Word);
  1512.  
  1513. Will clear the page [Pa]. [Pa] should be in the range [0..3].
  1514.  
  1515.  
  1516. Clip (Procedure)                                        TGK_GP
  1517. ──────────────────────────────────────────────────────────────
  1518.   Clip(Var X1,Y1,X2,Y2:Integer):Boolean;
  1519.  
  1520. Clips the coordinates pairs (X1,Y1) and (X2,Y2) to the current
  1521. viewport. Returns false if clipping could not be applied.
  1522.  
  1523.  
  1524. ClipLine (Procedure)                                    TGK_GP
  1525. ──────────────────────────────────────────────────────────────
  1526.   ClipLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  1527.  
  1528. Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], using color
  1529. [Color]. Will clip to the current viewport. If you do not want
  1530. to use clipping, use Line instead. This was done to allow for
  1531. high-speed linedrawing.
  1532.  
  1533.  
  1534. ClipObject (Function)                                   TGK_3D
  1535. ──────────────────────────────────────────────────────────────
  1536.   ClipObject(Nr:Word; XMin,XMax,YMin,YMax:Integer):ClipType;
  1537.  
  1538. Returns one of the values defined in ClipType. If the object
  1539. [Nr] does not clip with the rectangular area as specified by
  1540. (XMin,YMin)-(XMax,YMax), ClipNone is returned, otherwise, a
  1541. value in the range ClipLeft..ClipBottom is returned. For more
  1542. info on the clipping-constants available, look under ClipType.
  1543.  
  1544.  
  1545. ClipType (Type)                                         TGK_3D
  1546. ──────────────────────────────────────────────────────────────
  1547.   ClipType = (ClipNone,ClipLeft,ClipRight,ClipTop,ClipBottom);
  1548.  
  1549. This variable of this type is returned by the procedure Clip-
  1550. Object to determine if any clipping occurs for an object.
  1551.  
  1552.  
  1553. CloneAnimation (Procedure)                            TGK_ANIM
  1554. ──────────────────────────────────────────────────────────────
  1555.   CloneAnimation(Var SourceAnim,DestAnim:AnimType);
  1556.  
  1557. CloneAnimation clones the animation in [SourceAnim] to the one
  1558. in DestAnim. That is, they both share the same frames but
  1559. their actual behaviour may differ. This saves a lot of memory.
  1560. Actually, if a 10Kb animation is cloned, this will only eat up
  1561. approximately 50 more bytes of memory. Both animations need to
  1562. be initialized through the use of InitAnimation and it's
  1563. usually good practice to have a previously loaded or cloned
  1564. animation available in [SourceAnim] 8-)
  1565.  
  1566.  
  1567. CloseGraphics (Procedure)                             TGK_MAIN
  1568. ──────────────────────────────────────────────────────────────
  1569.  
  1570. This procedure shuts down the G∙A∙M∙E graphicsmode. It's not
  1571. necessary but good practice to call this program before your
  1572. program exits to DOS. If you do not call it explicitly, 
  1573. G∙A∙M∙E's own de-initialization code will call it.
  1574.  
  1575.  
  1576. CloseWindow (Procedure)                                TGK_WIN
  1577. ──────────────────────────────────────────────────────────────
  1578.   CloseWindow(Var Window:WindowType);
  1579.  
  1580. Closes the previously opened window [Window]. If the window
  1581. wasn't open, nothing happens.
  1582.  
  1583.  
  1584. CopyPage (Procedure)                                  TGK_MAIN
  1585. ──────────────────────────────────────────────────────────────
  1586.   CopyPage(SourcePa,DestPa:Word);
  1587.  
  1588. This procedure will copy the contents of page [SourcePa] to
  1589. page [DestPa]. Both [SourcePa] and [DestPa] should be in the
  1590. range [0..3].
  1591.  
  1592.  
  1593. CtrlPressed (Function)                                  TGK_IO
  1594. ──────────────────────────────────────────────────────────────
  1595.   CtrlPressed : Boolean;
  1596.  
  1597. Returns true if the Ctrl-Key is currently being pressed.
  1598.  
  1599.  
  1600. CurPage (Variable)                                    TGK_MAIN
  1601. ──────────────────────────────────────────────────────────────
  1602.   CurPage : Word;
  1603.  
  1604. This variable is merely here to allow for a certain compatibi-
  1605. lity amongst your programs. If you always use this variable to
  1606. point to the page you're drawing on, you can be use that a
  1607. procedure from another program will know what page to draw to
  1608. as well. Do with it what you want. I just use it ;-)
  1609.  
  1610.  
  1611. DACDevice (Variable)                                   TGK_SND
  1612. ──────────────────────────────────────────────────────────────
  1613.   DACDevice : SoundDevice = [Current Digital-Sound-Device];
  1614.  
  1615. This variable will always reflect the active digital-sound-
  1616. playback-device, which can be either Speaker, Adlib, Covox or
  1617. SoundBlaster. Btw, DACDevice is short for "Digital to Analog
  1618. Converter"-Device.
  1619.  
  1620.  
  1621. DefaultCursor (Const)                                   TGK_IO
  1622. ──────────────────────────────────────────────────────────────
  1623.   DefaultCursor : MouseStruct = (...);
  1624.  
  1625. This constant can be used as a paramter to SetMouseCursor to
  1626. restore the default shape of the mousecursor at any time.
  1627.  
  1628.  
  1629. DefaultExtension (Procedure)                          TGK_FILE
  1630. ──────────────────────────────────────────────────────────────
  1631.   DefaultExtension(Var FileName:String; Extension:String);
  1632.  
  1633. Will add the extension [Extension] to [FileName] only if
  1634. [FileName] currently does NOT HAVE an extension.
  1635.  
  1636.  
  1637. DefaultTextSettings (Procedure)                       TGK_TEXT
  1638. ──────────────────────────────────────────────────────────────
  1639.  
  1640. Restores all the textsettings to their default state and
  1641. values. Textspacing will be set to 2 pixels, textsize will be
  1642. restored to 100 (normal size), the internal font becomes the
  1643. active font, proportional-spacing will be set to true, hori-
  1644. zontal justification will be [Left], vertical justification
  1645. [Top] and the textmode will be set to [Speed].
  1646.  
  1647.  
  1648. DimmerLine (Procedure)                                  TGK_GP
  1649. ──────────────────────────────────────────────────────────────
  1650.   DimmerLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  1651.  
  1652. Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], giving it a
  1653. "dimmer" appeal. This will only work correctly when using the
  1654. default G∙A∙M∙E color-palette. [Color] specifies the color to
  1655. be used when underlying pixels have a value of zero. Use
  1656. BrighterLine as a contrastive procedure. Will either clip to
  1657. the current viewport boundaries or not, depending on the
  1658. setting of LineClipping.
  1659.  
  1660.  
  1661. DimmerPixel (Procedure)                                 TGK_GP
  1662. ──────────────────────────────────────────────────────────────
  1663.   DimmerPixel(X,Y:Integer; Color:Byte; Pa:Word);
  1664.  
  1665. Gives the pixel at position (X,Y) on page [Pa] a "dimmer"
  1666. appeal. This will only work correctly when using the default
  1667. G∙A∙M∙E color-palette. [Color] specifies the color to be used
  1668. when the underlying pixel has a value of zero. Use Brighter-
  1669. pixel as a contrastive procedure. Will clip to the current
  1670. viewport boundaries.
  1671.  
  1672.  
  1673. Direction (Type)                                        TGK_GP
  1674. ──────────────────────────────────────────────────────────────
  1675.   Direction = (Up,Down,Left,Right);
  1676.  
  1677. This is a type used in conjunction with ScrollPage to specify
  1678. one of four directions to move in. 
  1679. For example: ScrollPage(0,Down,1,10) will scroll page 0 down
  1680. for 1 pixel and fill with color 10.
  1681.  
  1682.  
  1683. DisableKeyboard (Procedure)                             TGK_IO
  1684. ──────────────────────────────────────────────────────────────
  1685.  
  1686. Completely disables the keyboard. No user input via the key-
  1687. board is possible until a call to EnableKeyboard is made.
  1688.  
  1689.  
  1690. DisposeAllFonts (Procedure)                           TGK_TEXT
  1691. ──────────────────────────────────────────────────────────────
  1692.  
  1693. Frees up the memory used by all of the loaded user-fonts. Only
  1694. the default font remains active.
  1695.  
  1696.  
  1697. DisposeAllObjects (Procedure)                           TGK_3D
  1698. ──────────────────────────────────────────────────────────────
  1699.  
  1700. Disposes of all the active vector-objects.
  1701.  
  1702.  
  1703. DisposeAnimation (Procedure)                            TGK_BM
  1704. ──────────────────────────────────────────────────────────────
  1705.   DisposeAnimation(Var Animation:AnimType);
  1706.  
  1707. Frees up any memory used by the animation [Animation] and re-
  1708. initalizes it. Should be called before program-termination or
  1709. when it's needed to free up some memory on the heap. It's good
  1710. practise to call this procedure after you know you won't have
  1711. any use for this animation anymore. Note: Cloned animations do
  1712. not have to be disposed. 
  1713.  
  1714.  
  1715. DisposeFont (Procedure)                               TGK_TEXT
  1716. ──────────────────────────────────────────────────────────────
  1717.   DisposeFont(Nr:Byte);
  1718.  
  1719. Frees up any memory used by the font loaded into slot [Nr].
  1720. [Nr] must be in the range 1..5 and if no font whatsoever has
  1721. been previously loaded into the specified slot, nothing hap-
  1722. pens. 
  1723.  
  1724.  
  1725. DisposeMusic (Procedure)                               TGK_SND
  1726. ──────────────────────────────────────────────────────────────
  1727.   DisposeMusic(Var MusicData:MusicType);
  1728.  
  1729. Frees up the memory used by the musical-score loaded into
  1730. [MusicData], if any.
  1731.  
  1732.  
  1733. DisposeObject (Procedure)                               TGK_3D
  1734. ──────────────────────────────────────────────────────────────
  1735.   DisposeObject(Nr:Word);
  1736.  
  1737. Disposes of the vector-object [Nr]. [Nr] must be in the range
  1738. 1..50 and the object must have been previously initalized
  1739. through a call to InitObject. This procedure should be called
  1740. after you're finised using the object.
  1741.  
  1742.  
  1743. DisposeSample (Procedure)                              TGK_SND
  1744. ──────────────────────────────────────────────────────────────
  1745.   DisposeSample(Var Sample:SampleType);
  1746.  
  1747. Frees up the memory used by the digital-sound loaded into
  1748. [Sample], if any.
  1749.  
  1750.  
  1751. DisposeSprite (Procedure)                               TGK_BM
  1752. ──────────────────────────────────────────────────────────────
  1753.   DisposeSprite(Var Sprite:SpriteType);
  1754.  
  1755. Frees up any memory used by sprite [Sprite] and re-initalizes
  1756. it. Should be called before program-termination or when it's
  1757. needed to free up some memory on the heap. It's good practise
  1758. to call this procedure after you know you won't have any use
  1759. for this sprite anymore.
  1760.  
  1761.  
  1762. DrawObjectFilled (Procedure)                            TGK_3D
  1763. ──────────────────────────────────────────────────────────────
  1764.   DrawObjectFilled(Nr,Pa:Word);
  1765.  
  1766. Draws the vector-object [Nr] on page [Pa], filling in all the
  1767. surfaces, using the color and fillstyle specified for each of
  1768. these surfaces with AddSurface.
  1769.  
  1770.  
  1771. DrawObjectWireFrame (Procedure)                         TGK_3D
  1772. ──────────────────────────────────────────────────────────────
  1773.   DrawObjectWireFrame(Nr,Pa:Word);
  1774.  
  1775. Draws the vector-object [Nr] on page [Pa], using a "connect-
  1776. the-dots"-system, drawing lines along the edges of all of the
  1777. surfaces that have been created. The color specified using
  1778. WireColor will be used.
  1779.  
  1780.  
  1781. Ellipse (Procedure)                                     TGK_GP
  1782. ──────────────────────────────────────────────────────────────
  1783.   Ellipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
  1784.  
  1785. Draws an ellipse on page [Pa], using color [Color]. The 
  1786. ellipse will be centered at (X,Y) and have a horizontal radius
  1787. of [XRadius] and a vertical radius of [YRadius] pixels. Will
  1788. clip to the current viewport.
  1789.  
  1790.  
  1791. EnableKeyboard (Procedure)                              TGK_IO
  1792. ──────────────────────────────────────────────────────────────
  1793.  
  1794. Re-enables a previously, through a call to DisableKeyboard,
  1795. disabled keyboard (otherwise, it has no effect at all...).
  1796.  
  1797.  
  1798. Error (Procedure)                                     TGK_MAIN
  1799. ──────────────────────────────────────────────────────────────
  1800.   Error(Message:String);
  1801.  
  1802. A call to Error shuts down the G∙A∙M∙E graphics mode, displays
  1803. the [Message] on screen and terminates the program.
  1804.  
  1805.  
  1806. Exist (Function)                                      TGK_FILE
  1807. ──────────────────────────────────────────────────────────────
  1808.   Exist(FileName:String):Boolean;
  1809.  
  1810. Returns true if the file named [FileName] exists on disk.
  1811.  
  1812.  
  1813. Extension (Function)                                  TGK_FILE
  1814. ──────────────────────────────────────────────────────────────
  1815.   Extension(FileName:String):String;
  1816.  
  1817. Returns the extension of the filename specified in [FileName].
  1818. If [FileName] has no extension, an empty string is returned.
  1819.  
  1820.  
  1821. FadeFromBlack (Procedure)                             TGK_MAIN
  1822. ──────────────────────────────────────────────────────────────
  1823.   FadeFromBlack(Speed:Byte);
  1824.  
  1825. Fades in the entire palette from black at the speed specified
  1826. by [Speed]. [Speed] should be in the range [0..255], where 0
  1827. is fastest speed and 255 slowest speed.
  1828.  
  1829.  
  1830. FadeFromColor (Procedure)                             TGK_MAIN
  1831. ──────────────────────────────────────────────────────────────
  1832.   FadeFromColor(Color,Speed:Byte);
  1833.  
  1834. Fades in the entire palette from the color specified by 
  1835. [Color] at the speed specified by [Speed]. If you want to make
  1836. sure you fade from an absolute colorvalue, have a look at the
  1837. code presented under SetColorPal. [Speed] should be in the
  1838. range [0..255], where 0 is fastest speed and 255 slowest
  1839. speed.
  1840.  
  1841.  
  1842. FadeFromWhite (Procedure)                             TGK_MAIN
  1843. ──────────────────────────────────────────────────────────────
  1844.   FadeFromWhite(Speed:Byte);
  1845.  
  1846. Fades in the entire palette from white at the speed specified
  1847. by [Speed]. [Speed] should be in the range [0..255], where 0
  1848. is fastest speed and 255 slowest speed.
  1849.  
  1850.  
  1851. FadeToBlack (Procedure)                               TGK_MAIN
  1852. ──────────────────────────────────────────────────────────────
  1853.   FadeToBlack(Speed:Byte);
  1854.  
  1855. Fades the entire palette to black at the speed specified by
  1856. [Speed]. [Speed] should be in the range [0..255], where 0 is
  1857. fastest speed and 255 slowest speed.
  1858.  
  1859.  
  1860. FadeToColor (Procedure)                               TGK_MAIN
  1861. ──────────────────────────────────────────────────────────────
  1862.   FadeToColor(Color,Speed:Byte);
  1863.  
  1864. Fades the entire palette to the color specified by [Color] at
  1865. the speed specified by [Speed]. If you want to make sure you
  1866. fade to an absolute colorvalue, have a look at the code pre-
  1867. sented under SetColorPal. [Speed] should be in the range
  1868. [0..255], where 0 is fastest speed and 255 slowest speed.
  1869.  
  1870.  
  1871. FadeToWhite (Procedure)                               TGK_MAIN
  1872. ──────────────────────────────────────────────────────────────
  1873.   FadeToWhite(Speed:Byte);
  1874.  
  1875. Fades the entire palette to white at the speed specified by
  1876. [Speed]. [Speed] should be in the range [0..255], where 0 is
  1877. fastest speed and 255 slowest speed.
  1878.  
  1879.  
  1880. FCircle (Procedure)                                     TGK_GP
  1881. ──────────────────────────────────────────────────────────────
  1882.   FCircle(X,Y,Radius:Integer; Color,Pa:Byte);
  1883.  
  1884. Draws a filled circle on page [Pa], using color [Color] and
  1885. the current fillstyle. The circle will be centered at (X,Y)
  1886. and have a radius of [Radius] pixels. Will clip to the current
  1887. viewport.
  1888.  
  1889.  
  1890. FEllipse (Procedure)                                    TGK_GP
  1891. ──────────────────────────────────────────────────────────────
  1892.   FEllipse(X,Y,XRadius,YRadius:Integer; Color,Pa:Byte);
  1893.  
  1894. Draws a filled ellipse on page [Pa], using color [Color] and
  1895. the current fillstyle. The ellipse will be centered at (X,Y)
  1896. and have a horizontal radius of [XRadius] and a vertical
  1897. radius of [YRadius] pixels. Will clip to the current viewport.
  1898.  
  1899.  
  1900. FileWindow (Function)                                  TGK_WIN
  1901. ──────────────────────────────────────────────────────────────
  1902.   FileWindow(X,Y,Pa:Word; Title,FileSpec:String) : String;
  1903.  
  1904. Pops up a file-selection-window entitled [Title] at position
  1905. (X,Y) on page [Pa]. [FileSpec] determines which files you can
  1906. pick from. The file chosen will be returned as the function
  1907. result. If no file was chosen, ie. the window was cancelled,
  1908. an empty string will be returned. Example:
  1909.  
  1910.  Var PasFile : String;
  1911.  
  1912.  PasFile:=FileWindow(10,10,0,'Pick a Pascal-File:','*.PAS');
  1913.  
  1914.  
  1915. FillPage (Procedure)                                  TGK_MAIN
  1916. ──────────────────────────────────────────────────────────────
  1917.   FillPage(Pa:Word;Color:Byte);
  1918.  
  1919. Fills the contents of page [Pa] with the color specified in
  1920. [Color]. [Pa] should be in the range [0..3] and color should
  1921. be in the range [0..255].
  1922.  
  1923.  
  1924. FillPatType (Type)                                    TGK_MAIN
  1925. ──────────────────────────────────────────────────────────────
  1926.   FillPatType = Array[0..15,0..15] of Byte;
  1927.  
  1928. Type used in combination with the procedure SetUserFill. This
  1929. array may be regarded as a simple bitmap. Each (x,y)-pair in
  1930. the array simply specifies the color for that point in the
  1931. fillpattern. Thus, to create sort of a diagonal, gray-shaded
  1932. fill, you could use a piece of code like this:
  1933.  
  1934. Var MyFill : FillPatType;
  1935.     X,Y    : Byte;
  1936.  
  1937.  For X:=0 To 15 Do
  1938.   For Y:=0 To 15 Do MyFill[X,Y]:=15+(X+Y) Mod 16;
  1939.  
  1940.  
  1941. FPoly (Procedure)                                       TGK_GP
  1942. ──────────────────────────────────────────────────────────────
  1943.   FPoly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
  1944.  
  1945. Draws a filled polygon on page [Pa], using color [Color] and
  1946. the current fillstyle. Will clip to the current viewport.
  1947. [NrPoints] specifies the number of coordinate-pairs in the
  1948. polygon and [Points] is an untyped variable containing an
  1949. array of (X,Y) coordinate-pairs. Let me demonstrate how all
  1950. this works:
  1951.  
  1952.  Const Form : Array[1..3,1..2] of Integer = 
  1953.                ((100,100),
  1954.                 (150,120),
  1955.                 (110,160));
  1956.  
  1957.  FPoly(3,Form,10,0);
  1958.  
  1959. This will draw a filled (triangular) polygon on page 0, using
  1960. color 10 and the three coordinates as specified in the array
  1961. [Form].
  1962.  
  1963.  
  1964. FrameRec (Type)                                       TGK_ANIM
  1965. ──────────────────────────────────────────────────────────────
  1966.   FrameRec = Array[1..50] of Record
  1967.                               Bitmap      : Pointer;
  1968.                               BMSize      : Word;
  1969.                               X,Y         : Integer;
  1970.                               XSize,YSize : Word;
  1971.                              End;
  1972.  
  1973. FrameType is a subtype used by [AnimType] to store the infor-
  1974. mation for one animation frame. [Bitmap] contains the actual
  1975. data for a frame, which is sized at [BMSize] bytes. [X] and
  1976. [Y] specify the relative offset of this frame from the (X,Y)-
  1977. position of the animation, whereas [XSize] and [YSize] respec-
  1978. tively contain the horizontal and vertical number of pixels in
  1979. the [Bitmap].
  1980.  
  1981.  
  1982. FRectangle (Procedure)                                  TGK_GP
  1983. ──────────────────────────────────────────────────────────────
  1984.   FRectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  1985.  
  1986. Draws a filled rectangle on page [Pa], using color [Color] and
  1987. the current fillstyle. The coordinate-pair (X1,Y1) denotes the
  1988. upperleft corner of the rectangle, whereas (X2,Y2) denotes the
  1989. lowerright corner. Clips to the current viewport.
  1990.  
  1991.  
  1992. FSquare (Procedure)                                     TGK_GP
  1993. ──────────────────────────────────────────────────────────────
  1994.   FSquare(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
  1995.  
  1996. Draws a filled square on page [Pa], using color [Color] and
  1997. the current fillstyle. The coordinate-pair (X1,Y1) denotes the
  1998. upperleft corner of the square, whereas (X1+Size,Y1+Size)
  1999. denotes the lowerright corner. Clips to the current viewport.
  2000.  
  2001.  
  2002. FTriangle (Procedure)                                   TGK_GP
  2003. ──────────────────────────────────────────────────────────────
  2004.   FTriangle(Triangle:TriangleType; Pa:Word);
  2005.  
  2006. Draws a filled triangle as specified in [Triangle] on page
  2007. [Pa], using the current fillstyle. Will clip to the current
  2008. viewport. For more info on how a variable of type TriangleType
  2009. is built up, have a look under the TriangleType header.
  2010.  
  2011.  
  2012. FullMouseRange (Procedure)                              TGK_IO
  2013. ──────────────────────────────────────────────────────────────
  2014.  
  2015. Sets the mouse-boundaries to use the entire screen, that is
  2016. (0,0)-(319,199).
  2017.  
  2018.  
  2019. FullPort (Procedure)                                  TGK_MAIN
  2020. ──────────────────────────────────────────────────────────────
  2021.  
  2022. A call to FullPort will restore the ViewPort to full size,
  2023. that is the whole screen or (0,0)-(319,199).
  2024.  
  2025.  
  2026. FunctionKey (Function)                                  TGK_IO
  2027. ──────────────────────────────────────────────────────────────
  2028.   FunctionKey : Boolean;
  2029.  
  2030. Returns true if the first key waiting in the keyboardbuffer is
  2031. a functionkey.
  2032.  
  2033.  
  2034. GamePort (Function)                                     TGK_IO
  2035. ──────────────────────────────────────────────────────────────
  2036.   GamePort : Boolean;
  2037.  
  2038. Returns true if a gameport is installed.
  2039.  
  2040.  
  2041. GetColor ( Procedure)                                 TGK_MAIN
  2042. ──────────────────────────────────────────────────────────────
  2043.   GetColor(Nr:Byte; Var Entry:RGBEntry);
  2044.  
  2045. Returns the respective red, green and blue values for palette
  2046. entry [Nr] in a variable of type RGBEntry. For some code, have
  2047. a look at SetColor.
  2048.  
  2049.  
  2050. GetImage (Procedure)                                    TGK_BM
  2051. ──────────────────────────────────────────────────────────────
  2052.   GetImage(X1,Y1,X2,Y2:Integer; 
  2053.            Var Sprite:SpriteType; Pa:Word);
  2054.  
  2055. GetImage will grab the contents of the rectangular area speci-
  2056. fied by the X- and Y-coordinates into the sprite [Sprite],
  2057. from page [Pa]. Before calling this procedure, [Sprite] needs
  2058. to be initialized using InitSprite. [Pa] should be in the
  2059. range [0..3]. You are free to choose the X- and Y-coordinates,
  2060. but they will clip to the current viewport.
  2061.  
  2062.  
  2063. GetJoyButton (Function)                                 TGK_IO
  2064. ──────────────────────────────────────────────────────────────
  2065.   GetJoyButton(JoyNr:Byte; Button:JoyButtonType):Boolean;
  2066.  
  2067. Returns true if the button specified in [Button] is currently
  2068. being pressed on the joystick specified in [JoyNr]. [JoyNr]
  2069. must be either 1 or 2 and [Button] is of type JoyButtonType,
  2070. which is described in more detail under JoyButtonType.
  2071.  
  2072.  
  2073. GetJoyDirection (Function)                              TGK_IO
  2074. ──────────────────────────────────────────────────────────────
  2075.   GetJoyDirection(JoyNr:Byte):JoyDirection;
  2076.  
  2077. Returns a function result of type [JoyDirection], reflecting
  2078. the current direction of joystick [JoyNr]. [JoyNr] must be
  2079. either 1 or 2. For a more detailed description of the type
  2080. [JoyDirection], look under JoyDirection.
  2081.  
  2082.  
  2083. GetJoyPosition (Function)                               TGK_IO
  2084. ──────────────────────────────────────────────────────────────
  2085.   GetJoyPosition(JoyNr:Byte; Axis:JoyPosType):Integer;
  2086.  
  2087. Returns the current joystickposition for joystick [JoyNr] on
  2088. the axis [Axis]. [JoyNr] must be either 1 or 2 and [Axis] is
  2089. of type JoyPosType, which is described in more detail under
  2090. JoyPosType.
  2091.  
  2092.  
  2093. GetMouseMotion (Procedure)                              TGK_IO
  2094. ──────────────────────────────────────────────────────────────
  2095.   GetMouseMotion(Var Horizontal,Vertical:Integer);
  2096.  
  2097. Return the number of pixels the mouse moved, since the last
  2098. coordinates passed by the mousedriver, in both [Horizontal]
  2099. and [Vertical] directions.
  2100.  
  2101.  
  2102. GetMouseSettings (Procedure)                            TGK_IO
  2103. ──────────────────────────────────────────────────────────────
  2104.   GetMouseSettings(Var MouseInfo:MouseSettingsType);
  2105.  
  2106. Returns the current mousestatus and settings. For more infor-
  2107. mation, have a look at the description of MouseSettingsType.
  2108.  
  2109.  
  2110. GetPalette (Procedure)                                TGK_MAIN
  2111. ──────────────────────────────────────────────────────────────
  2112.   GetPalette(Var Palette);
  2113.  
  2114. Returns the actual palette in any structure denoted to by
  2115. [Palette]. It is, however, good practice to use the G∙A∙M∙E
  2116. PaletteType as the default structure, as this will assure
  2117. compatibility with other procedures and functions.
  2118.  
  2119.  
  2120. GetPixel (Function)                                     TGK_GP
  2121. ──────────────────────────────────────────────────────────────
  2122.   GetPixel(X,Y:Integer; Pa:Word):Byte;
  2123.  
  2124. Returns the value of the pixel at coordinates (X,Y) on page
  2125. [Pa]. Returns a value of zero for pixels located outside of
  2126. the viewport.
  2127.  
  2128.  
  2129. GetTextSettings (Procedure)                           TGK_TEXT
  2130. ──────────────────────────────────────────────────────────────
  2131.   GetTextSettings(Var Settings:TextSettingsType);
  2132.  
  2133. Saves all important textsettings, such as the active font,
  2134. character spacing, whether proportional spacing is active,
  2135. horizontal and vertical justification and the textmode in a
  2136. record pointed to by [Settings]. After a call to this procedu-
  2137. re, one can fiddle around with the textsetting and at a later
  2138. moment in time restore the old settings through a call to
  2139. SetTextSettings, which uses the previously saved textsettings-
  2140. record to restore the old settings.
  2141.  
  2142.  
  2143. GetWindowColors (Procedure)                            TGK_WIN
  2144. ──────────────────────────────────────────────────────────────
  2145.   GetWindowColors(Var ColorSet:WindowColorSet);
  2146.  
  2147. Retrieves the current color selection for the windows. For a
  2148. more detailed explanation, look under WindowColorSet.
  2149.  
  2150.  
  2151. GlobalVol (Variable)                                   TGK_SND
  2152. ──────────────────────────────────────────────────────────────
  2153.   GlobalVol : Real = [The current overall-volume...];
  2154.  
  2155. This variable contains a value in the range 0..1, reflecting
  2156. the current overall-volume of the FM-Music routines (thus, the
  2157. digital-sound-routines are not affected by this value). Set it
  2158. to 1.0 for full volume, to 0.5 for about 25% of the original
  2159. volume.
  2160.  
  2161.  
  2162. GoodName (Procedure)                                  TGK_FILE
  2163. ──────────────────────────────────────────────────────────────
  2164.  
  2165. As for now, this procedure is for internal use by the G∙A∙M∙E
  2166. program only.
  2167.  
  2168.  
  2169. HandleAnimation (Procedure)                           TGK_ANIM
  2170. ──────────────────────────────────────────────────────────────
  2171.   HandleAnimation(Var Animation:AnimType; Pa:Word);
  2172.  
  2173. Updates all the necessary parameters for the movement and
  2174. behaviour of animation [Animation] and, if required, displays
  2175. it on page [Pa]. If UseMask is set to true, it will use the
  2176. mask-page, otherwise it won't.
  2177.  
  2178.  
  2179. HandleWindow (Procedure)                               TGK_WIN
  2180. ──────────────────────────────────────────────────────────────
  2181.   HandleWindow(Var Window:WindowType):Word;
  2182.  
  2183. Checks to see if any buttons are being pressed for window
  2184. [Window]. If so, the number of the button on which the action
  2185. was performed will be returned. If zero (0) is returned, the
  2186. window has been closed using the close button.
  2187.  
  2188.  
  2189. HideObject (Procedure)                                  TGK_3D
  2190. ──────────────────────────────────────────────────────────────
  2191.   HideObject(Nr:Word);
  2192.  
  2193. Marks the non-visible-part of vector-object [Nr]. This proce-
  2194. dure should be called before displaying the object. It will
  2195. cause the non-visible surfaces not to be drawn, creating a
  2196. much more life-like and professional appearance.
  2197.  
  2198.  
  2199. HLine (Procedure)                                       TGK_GP
  2200. ──────────────────────────────────────────────────────────────
  2201.   HLine(X1,Y1,X2:Integer; Color:Byte; Pa:Word);
  2202.  
  2203. Draws a horizontal line from (X1,Y1) to (X2,Y1) on page [Pa],
  2204. using color [Color]. Clips to the current viewport.
  2205.  
  2206.  
  2207. InitAnimation (Procedure)                               TGK_BM
  2208. ──────────────────────────────────────────────────────────────
  2209.   InitAnimation(Var Animation:AnimType);
  2210.  
  2211. Initializes the animation [Animation] for use with G∙A∙M∙E.
  2212. Should be called before doing anything with the animation. 
  2213.  
  2214.  
  2215. InitFile (Function)                                   TGK_FILE
  2216. ──────────────────────────────────────────────────────────────
  2217.   InitFile(Var FileHandle:File; FileName:String; 
  2218.            Var FSize:LongInt):Boolean;
  2219.  
  2220. This procedure is used to open a file no matter in what subdi-
  2221. rectory it resides and whether or not it resides in a G∙A∙M∙E
  2222. resource-file. If found, the file named [FileName] will be
  2223. assigned to the handle [FileHandle] and be opened. If the file
  2224. resides in a resource-file, the file-pointer will be located
  2225. at the start of the needed data. The size of the data will be
  2226. returned in [FSize].
  2227. When you write your own procedures using this function, please
  2228. notice that if your file was found inside of a resource-file,
  2229. Turbo Pascal functions such as FileSize and Seek will not work
  2230. properly. Therefore, the filesize is returned in [FSize] and
  2231. you should always do a relative seek, such as Seek(MyFile,Fi-
  2232. lePos(MyFile)+10) instead of Seek(MyFile,10).
  2233.  
  2234.  
  2235. InitMouse (Procedure)                                   TGK_IO
  2236. ──────────────────────────────────────────────────────────────
  2237.  
  2238. Tries to initialize the mouse for use with G∙A∙M∙E. If succes-
  2239. ful, MouseDriver will be set to true and NrOfButtons will
  2240. contain the number of buttons found on your mouse.
  2241.  
  2242.  
  2243. InitMusic (Procedure)                                  TGK_SND
  2244. ──────────────────────────────────────────────────────────────
  2245.   InitMusic(Var MusicData:MusicType);
  2246.  
  2247. Initializes [MusicData], a variable of type MusicType, for use
  2248. with G∙A∙M∙E. This procedure must be called before doing
  2249. anything else with the [MusicData] variable.
  2250.  
  2251.  
  2252. InitObject (Procedure)                                  TGK_3D
  2253. ──────────────────────────────────────────────────────────────
  2254.   InitObject(Nr:Word);
  2255.  
  2256. Initializes the vector-object [Nr] for use with G∙A∙M∙E. [Nr]
  2257. must be in the range 1..50. This should be the first call you
  2258. make before doing anything else with the object.
  2259.  
  2260.  
  2261. InitSample (Procedure)                                 TGK_SND
  2262. ──────────────────────────────────────────────────────────────
  2263.   InitSample(Var Sample:SampleType);
  2264.  
  2265. Initializes [Sample], a variable of type SampleType, for use
  2266. with G∙A∙M∙E. This procedure must be called before doing
  2267. anything else with the [Sample] variable.
  2268.  
  2269.  
  2270. InitSprite (Procedure)                                  TGK_BM
  2271. ──────────────────────────────────────────────────────────────
  2272.   InitSprite(Var Sprite:SpriteType);
  2273.  
  2274. Initializes the sprite [Sprite] for use with G∙A∙M∙E. Should
  2275. be called before doing anything else with the sprite.
  2276.  
  2277.  
  2278. InitWindow (Procedure)                                 TGK_WIN
  2279. ──────────────────────────────────────────────────────────────
  2280.   InitWindow(Var Window:WindowType;
  2281.                  X,Y,XSize,YSize:Integer; Title:String);
  2282.  
  2283. Initializes the window [Window] for use with G∙A∙M∙E. When
  2284. opened the window will be placed at the coordinates (X,Y),
  2285. will be [XSize] pixels in size horizontally, [YSize] pixels
  2286. vertically and have a title as specified in [Title]. This
  2287. should be your first call when using a new variable of type
  2288. WindowType.
  2289.  
  2290.  
  2291. IsBusy (Variable)                                     TGK_MAIN
  2292. ──────────────────────────────────────────────────────────────
  2293.   IsBusy : Boolean;
  2294.  
  2295. This variable is used in conjunction with interrupt procedu-
  2296. res. Suppose you've got a procedure that will change the shape
  2297. of your mousecursor every 10th of a second, to a allow for an
  2298. animated mousecursor. Who guaranties that when you interrupt
  2299. the program to draw the new cursor, it wasn't already drawing
  2300. something else? This is where the IsBusy variable is introdu-
  2301. ced. When it's set to true, the program is currently drawing
  2302. to the screen and thus shouldn't be interrupted. Just wait
  2303. until it's false and then execute your procedure. Yes, you've
  2304. guessed it; It's a good idea to set IsBusy to true when dra-
  2305. wing your new mousecursor so no other interrupt-procedure will
  2306. mess up what you're doing... However, do not forget to set it
  2307. to false after you're finished or otherwise the next operation
  2308. that writes to the screen won't output much...
  2309.  
  2310.  
  2311. JoyButtonType (Type)                                    TGK_IO
  2312. ──────────────────────────────────────────────────────────────
  2313.   JoyButtonType = (JoyLeftBut,JoyRightBut);
  2314.  
  2315. This type is used in conjunction with GetJoyButton to detect
  2316. whether the left or right joystick button is pressed.
  2317.  
  2318.  
  2319. JoyDirection (Type)                                     TGK_IO
  2320. ──────────────────────────────────────────────────────────────
  2321.   JoyDirection = (LeftDir,RightDir,UpDir,DownDir,
  2322.                   NoDir,UpLeftDir,UpRightDir,
  2323.                   DownLeftDir,DownRightDir);
  2324.  
  2325. This type is returned as a function result for GetJoyDirection
  2326. and reflects the current direction for a joystick.
  2327.  
  2328.  
  2329. JoyPosType (Type)                                       TGK_IO
  2330. ──────────────────────────────────────────────────────────────
  2331.   JoyPosType = (XPosition,YPosition);
  2332.  
  2333. This type is used in conjunction with GetJoyPosistion to
  2334. retrieve the position for either the horizontal or vertical
  2335. axis for a joystick.
  2336.  
  2337.  
  2338. JoyStickExists (Function)                               TGK_IO
  2339. ──────────────────────────────────────────────────────────────
  2340.   JoyStickExists(JoyNr:Byte):Boolean;
  2341.  
  2342. Returns true if joystick [JoyNr] exists. [JoyNr] must be
  2343. either 1 or 2.
  2344.  
  2345.  
  2346. KeyPressed (Function)                                   TGK_IO
  2347. ──────────────────────────────────────────────────────────────
  2348.   KeyPressed : Boolean;
  2349.  
  2350. Returns true if a key is waiting in the keyboard buffer.
  2351.  
  2352.  
  2353. KeyTable (Variable)                                     TGK_IO
  2354. ──────────────────────────────────────────────────────────────
  2355.   KeyTable : Array[1..127] of Boolean;
  2356.  
  2357. Each position in this table reflects the current state of a
  2358. key on the keyboard. If set to true, the key is currently
  2359. down, otherwise it isn't. For a complete list of keyboard
  2360. scancodes, have a look at Appendix A: Keyboard scancodes.
  2361. It really is pretty simple to use this table. For example, to
  2362. have your program wait until the user presses the ESC-key,
  2363. simple use some code like this:
  2364.  
  2365.  While Not KeyTable[1] do;
  2366.  
  2367. The fun part about it is that you can detect more than one
  2368. keypress at a time, thus you can simply check for a combinati-
  2369. on of keys being pressed using an AND statement. Try it 8-)
  2370.  
  2371.  
  2372. LeftButton (Function)                                   TGK_IO
  2373. ──────────────────────────────────────────────────────────────
  2374.   LeftButton : Boolean;
  2375.  
  2376. Returns true if the left mousebutton is currently down.
  2377.  
  2378.  
  2379. LeftText (Const)                                      TGK_TEXT
  2380. ──────────────────────────────────────────────────────────────
  2381.   LeftText = 0;
  2382.  
  2383. Used in conjunction with SetTextJustify, for more information
  2384. on how this procedure works, have a look under the appropriate
  2385. header.
  2386.  
  2387.  
  2388. Line (Procedure)                                        TGK_GP
  2389. ──────────────────────────────────────────────────────────────
  2390.   Line(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  2391.  
  2392. Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], using color
  2393. [Color]. Will NOT clip to the current viewport. If you want to
  2394. use clipping, use ClipLine instead. This was done to allow for
  2395. high-speed linedrawing.
  2396.  
  2397.  
  2398. LineClipping (Variable)                                 TGK_GP
  2399. ──────────────────────────────────────────────────────────────
  2400.   LineClipping : Boolean;
  2401.  
  2402. When set to true, certain procedures in the TGK_GP-unit will
  2403. clip to the current viewport. When set to false, they won't.
  2404. Set to false for speedier line-drawing procedures when you are
  2405. sure they won't cross the viewport-boundaries.
  2406.  
  2407.  
  2408. LoadAnimation (Procedure)                             TGK_ANIM
  2409. ──────────────────────────────────────────────────────────────
  2410.   LoadAnimation(Var Animation:AnimType; FileName:String);
  2411.  
  2412. This procedure will load a previously stored animation from
  2413. disk into [Animation]. [Animation] should first be initialized
  2414. by issuing a call to InitAnimation. The extension for [FileNa-
  2415. me] defaults to [.GAF], which is short for G∙A∙M∙E Animation
  2416. File.
  2417.  
  2418.  
  2419. LoadBBM (Procedure)                                   TGK_FILE
  2420. ──────────────────────────────────────────────────────────────
  2421.   LoadBBM(FileName:String; Var Sprite:SpriteType);
  2422.  
  2423. Loads a "DeLuxe Paint" brush from disk from the file named
  2424. [FileName] into a variable, [Sprite], of type SpriteType that
  2425. must have been previously initialized using InitSprite. If no
  2426. extension is specified, [.BBM] will be assumed.
  2427.  
  2428.  
  2429. LoadBMP (Procedure)                                   TGK_FILE
  2430. ──────────────────────────────────────────────────────────────
  2431.   LoadBMP(FileName:String; Pa:Word);
  2432.  
  2433. This procedure will load a previously stored BMP (Windows
  2434. BitMaP) file from disk. The file must be exactly 320 pixels in
  2435. width and 200 pixels in height and use 256 colors. The name of
  2436. the file must be [FileName] and it will be loaded to the page
  2437. specified by [Pa]. If a resource-file is currently active,
  2438. that is, [Resource] has been assigned a name, this procedure
  2439. will try to load the file from the resource. If no extension
  2440. is specified, [.BMP] will be assumed.
  2441.  
  2442.  
  2443. LoadFont (Procedure)                                  TGK_TEXT
  2444. ──────────────────────────────────────────────────────────────
  2445.   LoadFont(Name:String; Nr:Byte);
  2446.  
  2447. Will load the font [Name] from disk. If no extension is speci-
  2448. fied, [.GFF] (short for G∙A∙M∙E-Font File) will be assumed.
  2449. [Nr] must be in the range 1..5 and specifies in which userslot
  2450. to load the font. Slot 0 may not be used because this slot
  2451. always contains the internal font. Font can be converted from
  2452. other programs using the GAMEFONT program as discussed in
  2453. chapter 4, paragraph 4.4.
  2454.  
  2455.  
  2456. LoadGIF (Procedure)                                   TGK_FILE
  2457. ──────────────────────────────────────────────────────────────
  2458.   LoadGIF(FileName:String; Pa:Word);
  2459.  
  2460. This procedure will load a previously stored GIF (Graphics
  2461. Interchange Format) file from disk. These files can be created
  2462. using various paint-programs and can be found on many diffe-
  2463. rent bulletin boards. If the file is too large to fit on the
  2464. screen it will be cropped to 320 pixels wide and 200 pixels
  2465. high. The name of the file must be [FileName] and it will be
  2466. loaded to the page specified by [Pa]. If a resource-file is
  2467. currently active, that is, [Resource] has been assigned a
  2468. name, this procedure will try to load the file from the re-
  2469. source. If no extension is specified, [.GIF] will be assumed.
  2470.  
  2471.  
  2472. LoadGPF (Procedure)                                   TGK_FILE
  2473. ──────────────────────────────────────────────────────────────
  2474.   LoadGPF(FileName:String; Pa:Word);
  2475.  
  2476. This procedure will load a previously stored G∙A∙M∙E-Picture
  2477. File from disk. This file might have been created using the
  2478. GAMECAP screen-capture program or through the use of SaveGPF.
  2479. The name of the file must be [FileName] and it will be loaded
  2480. to the page specified by [Pa]. If a resource-file is currently
  2481. active, that is, [Resource] has been assigned a name, this
  2482. procedure will try to load the file from the resource. If no
  2483. extension is specified, [.GPF] will be assumed.
  2484.  
  2485.  
  2486. LoadImage (Procedure)                                 TGK_FILE
  2487. ──────────────────────────────────────────────────────────────
  2488.   LoadImage(FileName:String; Var Sprite:SpriteType);
  2489.  
  2490. Loads a previously saved sprite from disk from the file named
  2491. [FileName] into a variable, [Sprite], of type SpriteType that
  2492. must have been previously initialized using InitSprite. The
  2493. default extension used, if none specified, is [.GSF] (G∙A∙M∙E-
  2494. Sprite File).
  2495.  
  2496.  
  2497. LoadLBM (Procedure)                                   TGK_FILE
  2498. ──────────────────────────────────────────────────────────────
  2499.   LoadLBM(FileName:String; Pa:Word);
  2500.  
  2501. This procedure will load a previously stored LBM (Electronic
  2502. Arts' interLeaved BitMap) file from disk. These files can be
  2503. created using various paint-programs. The file must be exactly
  2504. 320 pixels in width and 200 pixels in height and use 256
  2505. colors. The name of the file must be [FileName] and it will be
  2506. loaded to the page specified by [Pa]. If a resource-file is
  2507. currently active, that is, [Resource] has been assigned a
  2508. name, this procedure will try to load the file from the re-
  2509. source. If no extension is specified, [.LBM] will be assumed.
  2510.  
  2511.  
  2512. LoadMusic (Procedure)                                  TGK_SND
  2513. ──────────────────────────────────────────────────────────────
  2514.   LoadMusic(Var MusicData:MusicType; FileName:String);
  2515.  
  2516. Loads a previously stored music-file, named [FileName], from
  2517. disk into the variable [MusicData], which must have been
  2518. previously initialized through a call to InitMusic. The exten-
  2519. sion for [FileName] defaults to [.GMF], which is short for
  2520. G∙A∙M∙E-MusicFile.
  2521.  
  2522.  
  2523. LoadPath (Procedure)                                  TGK_ANIM
  2524. ──────────────────────────────────────────────────────────────
  2525.   LoadPath(Var Animation:AnimType; FileName:String);
  2526.  
  2527. Loads a previously stored path from disk into the [Path] for
  2528. [Animation]. The animation must have been initialized through
  2529. a call to InitAnimation. The extension for [FileName] defaults
  2530. to [.PTH], for PaTHfile. For more information on animation-
  2531. paths, look under PathType.
  2532.  
  2533.  
  2534. LoadPCX (Procedure)                                   TGK_FILE
  2535. ──────────────────────────────────────────────────────────────
  2536.   LoadPCX(FileName:String; Pa:Word);
  2537.  
  2538. This procedure will load a previously stored PCX-file from
  2539. disk. These files can be created using various paint-programs.
  2540. The file must be exactly 320 pixels in width and 200 pixels in
  2541. height and use 256 colors. The name of the file must be [File-
  2542. Name] and it will be loaded to the page specified by [Pa]. If
  2543. a resource-file is currently active, that is, [Resource] has
  2544. been assigned a name, this procedure will try to load the file
  2545. from the resource. If no extension is specified, [.PCX] will
  2546. be assumed.
  2547.  
  2548.  
  2549. LoadSample (Procedure)                                 TGK_SND
  2550. ──────────────────────────────────────────────────────────────
  2551.   LoadSample(Var Sample:SampleType; 
  2552.              FileName:String; Signed:Boolean);
  2553.  
  2554. Loads a previously stored digital-sound, named [FileName],
  2555. from disk into the variable [Sample], which must have been
  2556. previously initialized through a call to InitSample. The
  2557. extension for [FileName] defaults to [.GSF], which is short
  2558. for G∙A∙M∙E-SampleFile. [Signed] specifies whether the sample
  2559. is in unsigned- (IBM, SoundBlaster) or signed-format (Amiga).
  2560. Samples that come from MOD-files are signed, for example.
  2561.  
  2562.  
  2563. LongDiv (Function)                                    TGK_MAIN
  2564. ──────────────────────────────────────────────────────────────
  2565.   LongDiv(X:LongInt; Y:Integer):Integer;
  2566.  
  2567. Divides the longint [X] by the value in [Y] and returns an
  2568. integer function result. Merely included for speed, as it is a
  2569. lot faster than Turbo's default longint division.
  2570.  
  2571.  
  2572. LongMod (Function)                                    TGK_MAIN
  2573. ──────────────────────────────────────────────────────────────
  2574.   LongMod(X:LongInt; Y:Integer):Integer;
  2575.  
  2576. Divides the longint [X] by the value in [Y] and returns the
  2577. remainder of this division as an integer function result.
  2578. Merely included for speed, as it is a lot faster than Turbo's
  2579. default function.
  2580.  
  2581.  
  2582. LongMul (Function)                                    TGK_MAIN
  2583. ──────────────────────────────────────────────────────────────
  2584.   LongMul(X,Y:Integer):LongInt;
  2585.  
  2586. Performs multiplication of the two integer variables [X] and
  2587. [Y} and returns a longint. Merely included for speed, as it is
  2588. a lot faster than Turbo's default longint multiplication.
  2589.  
  2590.  
  2591. LShiftPressed (Function)                                TGK_IO
  2592. ──────────────────────────────────────────────────────────────
  2593.   LShiftPressed : Boolean;
  2594.  
  2595. Returns true if the Left Shift-Key is currently being pressed.
  2596.  
  2597.  
  2598. MaxButtons (Constant)                                  TGK_WIN
  2599. ──────────────────────────────────────────────────────────────
  2600.   MaxButtons = 30;
  2601.  
  2602. This constant reflects the highest button-number that can be
  2603. added to a window using any of the AddButton functions, such
  2604. as AddPushButton and AddCheckButton. Any value higher than
  2605. MaxButtons passed to these procedures will cause them to
  2606. terminate without doing anything.
  2607.  
  2608.  
  2609. MessageWindow (Procedure)                              TGK_WIN
  2610. ──────────────────────────────────────────────────────────────
  2611.   MessageWindow(X,Y,Pa:Word; Message:String);
  2612.  
  2613. Pops up a message-window at position (X,Y) on page [Pa]. The
  2614. message [Message] will be displayed. Adding a #13 (CR) in the
  2615. message will cause the text-display to wrap around to the next
  2616. line at that position. An example:
  2617.  
  2618.  MessageWindow(10,10,0,'This will be on the first'#13+
  2619.                        'and this on the second line...');
  2620.  
  2621.  
  2622. MiddleButton (Function)                                 TGK_IO
  2623. ──────────────────────────────────────────────────────────────
  2624.   MiddleButton : Boolean;
  2625.  
  2626. Returns true if the middle mousebutton is currently down. Try
  2627. avoiding the use of this function because not all mouses have
  2628. three buttons and hey, two is more than enough almost always.
  2629. Remember those Apple-guys? They've got only one ;-) (Which
  2630. could be called the middle button, I know... but it's the left
  2631. as well AND the right!) Thiz sucks...
  2632.  
  2633.  
  2634. MinX, MinY, MaxX and MaxY (Variable)                  TGK_MAIN
  2635. ──────────────────────────────────────────────────────────────
  2636.  
  2637. These variables define the actual viewport for all graphics
  2638. operations. Do not alter them directly but only through the
  2639. use of SetViewPort and FullPort.
  2640.  
  2641.  
  2642. ModeType (Type)                                        TGK_SND
  2643. ──────────────────────────────────────────────────────────────
  2644.   ModeType = (Melodic,Percussive);
  2645.  
  2646. Used by the procedure SetMode. For more information look under
  2647. the appropriate header.
  2648.  
  2649.  
  2650. MoveObject (Procedure)                                  TGK_3D
  2651. ──────────────────────────────────────────────────────────────
  2652.   MoveObject(Nr:Word; X,Y,Z:Integer);
  2653.  
  2654. Moves the position in 3D-Space for vector-object [Nr]. This is
  2655. done relatively to it's current position for [X], [Y] and [Z]
  2656. pixels along the respective axes.
  2657.  
  2658.  
  2659. MoveOrigin (Procedure)                                  TGK_3D
  2660. ──────────────────────────────────────────────────────────────
  2661.   MoveOrigin(Nr:Word; X,Y:Integer);
  2662.  
  2663. Moves the position on screen for vector-object [Nr] relatively
  2664. to it's current position for [X] pixels along the horizontal
  2665. axis and [Y] pixels along the vertical axis.
  2666.  
  2667.  
  2668. MouseCursorOff (Procedure)                              TGK_IO
  2669. ──────────────────────────────────────────────────────────────
  2670.  
  2671. Turns off the mousecursor.
  2672.  
  2673.  
  2674. MouseCursorOn (Procedure)                               TGK_IO
  2675. ──────────────────────────────────────────────────────────────
  2676.  
  2677. Turns on the mousecursor. The G∙A∙M∙E graphics mode must have
  2678. been previously initialized through a call to OpenGraphics and
  2679. the mouse must have been previously initialized through a call
  2680. to InitMouse.
  2681.  
  2682.  
  2683. MouseDriver (Const)                                     TGK_IO
  2684. ──────────────────────────────────────────────────────────────
  2685.   MouseDriver : Boolean;
  2686.  
  2687. This constant reflects whether a mousedriver is installed or
  2688. not. If set to true, a mousedriver was found, otherwise no
  2689. mousedriver could be detected.
  2690.  
  2691.  
  2692.  
  2693. MouseIn (Function)                                      TGK_IO
  2694. ──────────────────────────────────────────────────────────────
  2695.   MouseIn(X1,Y1,X2,Y2:Integer) : Boolean;
  2696.  
  2697. Return true if the current mouse-coordinates fall within the
  2698. rectangular area defined by [X1], [Y1], [X2] and [Y2].
  2699.  
  2700.  
  2701. MouseMoved (Function)                                   TGK_IO
  2702. ──────────────────────────────────────────────────────────────
  2703.  
  2704. Returns true if the mouse-coordinates have changes since the
  2705. last ones passed by the mousedriver.
  2706.  
  2707.  
  2708. MousePointer (Variable)                                 TGK_IO
  2709. ──────────────────────────────────────────────────────────────
  2710.   MousePointer : Boolean;
  2711.  
  2712. This boolean reflects the current state of the mousecursor. If
  2713. the mousecursor is visible, it is set to true, otherwise it is
  2714. false.
  2715.  
  2716.  
  2717. MouseSettingsType (Type)                                TGK_IO
  2718. ──────────────────────────────────────────────────────────────
  2719.  
  2720. This type is of no further interest to the user but is used by
  2721. GetMouseSettings and SetMouseSettings to respectively save and
  2722. restore the state of the mouse. Important things such as the
  2723. state of the mousecursor, the current viewport for the mouse
  2724. and special range are stored in this type.
  2725.  
  2726.  
  2727. MouseStruct (Type)                                      TGK_IO
  2728. ──────────────────────────────────────────────────────────────
  2729.   MouseStruct = Array[0..19,0..19] of Byte;
  2730.  
  2731. This type is used in conjunction with SetMouseCursor. Each
  2732. (X,Y)-position in the array reflects the colorvalue for that
  2733. pixel of the mouse cursor. Thus, this array can be regarded as
  2734. a simple bitmap for the shape of the mousecursor.
  2735.  
  2736.  
  2737. MouseX and MouseY (Variable)                            TGK_IO
  2738. ──────────────────────────────────────────────────────────────
  2739.   MouseX,MouseY : Integer;
  2740.  
  2741. These variables reflect the current X- and Y-coordinate of the
  2742. mousecursor. They can, but normally shouldn't, be changed by
  2743. the user.
  2744.  
  2745.  
  2746. MoveBlock (Procedure)                                 TGK_MAIN
  2747. ──────────────────────────────────────────────────────────────
  2748.   MoveBlock(X1,Y1,X2,Y2:Integer; SourcePa,DestPa:Word);
  2749.  
  2750. A call to MoveBlock will copy the contents of the rectangular
  2751. area specified by [X1], [Y1], [X2] and [Y2] from page [Source-
  2752. Pa] to page [DestPa]. You are free to choose the rectangular
  2753. area, but it will be clipped to the screen boundaries. Both
  2754. [SourcePa] and [DestPa] should be in the range [0..3].
  2755.  
  2756.  
  2757. MusHdr (Type)                                          TGK_SND
  2758. ──────────────────────────────────────────────────────────────
  2759.   MusHdr = Record [...];
  2760.  
  2761. This is a subtype used by the MusicType type. It is of no
  2762. further interest to the user.
  2763.  
  2764.  
  2765. MusicDevice (Variable)                                 TGK_SND
  2766. ──────────────────────────────────────────────────────────────
  2767.   MusicDevice : SoundDevice = [Current Music-Device];
  2768.  
  2769. This variable will always reflect the active music-playback-
  2770. device, which can be either Speaker, Adlib or SoundBlaster.
  2771.  
  2772.  
  2773. MusicPlaying (Variable)                                TGK_SND
  2774. ──────────────────────────────────────────────────────────────
  2775.   MusicPlaying : Boolean = [Any music, Maestro?];
  2776.  
  2777. [MusicPlaying] reflects the current state of the G∙A∙M∙E FM-
  2778. Music Playback System. If it is currently playing a song, the
  2779. variable [MusicPlaying] will be set to true. Otherwise, it
  2780. will be set to false.
  2781.  
  2782.  
  2783. MusInfo (Variable)                                     TGK_SND
  2784. ──────────────────────────────────────────────────────────────
  2785.   MusInfo : Record
  2786.              Note        : Array[1..11] of Byte;
  2787.              Volume      : Array[1..11] of Byte;
  2788.              PitchBend   : Array[1..11] of Word;
  2789.              PercentDone : Byte;
  2790.             End;
  2791.  
  2792. This record contains useful information about the current FM-
  2793. Music that is playing (if any). The [Note] fields contain the
  2794. current note being played for each of the 11 voices available.
  2795. For more information on note-values, have a look at NoteOn.
  2796. The [Volume] fields contain the relative volume for each voice
  2797. and the [PitchBend] fields the amount of "Pitch-Bending"
  2798. applied to each voice, where 100=Normal Note, 0=Down one note
  2799. and 200=Up one Note. Finally, the [PercentDone] field contains
  2800. a value which indicates how many percent of the song has been
  2801. played.
  2802.  
  2803.  
  2804. MusType (Type)                                         TGK_SND
  2805. ──────────────────────────────────────────────────────────────
  2806.   MusType = Record [...];
  2807.  
  2808. This type is used by the various music-playback-routines found
  2809. in TGK_SND. It contains no fields of interest to the user.
  2810.  
  2811.  
  2812. NewExtension (Procedure)                              TGK_FILE
  2813. ──────────────────────────────────────────────────────────────
  2814.   NewExtension(Var FileName:String; Extension:String);
  2815.  
  2816. Changes the extension of [FileName] to [Extension], deleting
  2817. any possible existing extension.
  2818.  
  2819.  
  2820. NewResource (Procedure)                               TGK_FILE
  2821. ──────────────────────────────────────────────────────────────
  2822.  
  2823. Initializes a new resource file with a filename as specified
  2824. with the [Resource] variable. If the resource already exists,
  2825. you will be prompted whether you want to overwrite the exis-
  2826. ting file or append data to it. There's really not much point
  2827. in using this procedure, unless you would like to create your
  2828. own resource-file maker, such as MAKERES. 
  2829.  
  2830.  
  2831. No (Constant)                                          TGK_WIN
  2832. ──────────────────────────────────────────────────────────────
  2833.   No = False;
  2834.  
  2835. May be used to test the result of a call to QuestionWindow for
  2836. a negative answer. Alas, it makes your code look neat, but
  2837. there is no further function... 8-)
  2838.  
  2839.  
  2840. NoSpecialRange (Procedure)                              TGK_IO
  2841. ──────────────────────────────────────────────────────────────
  2842.  
  2843. Removes a previously defined special range for mouse.
  2844.  
  2845.  
  2846. NoteOff (Procedure)                                    TGK_SND
  2847. ──────────────────────────────────────────────────────────────
  2848.   NoteOff(Voice:Byte);
  2849.  
  2850. Turns of the currently sounding note (if any) for voice number
  2851. [Voice] on the active music-device. If the active music-device
  2852. is the internal speaker, the [Voice] parameter is a dummy one.
  2853.  
  2854.  
  2855. NoteOn (Procedure)                                     TGK_SND
  2856. ──────────────────────────────────────────────────────────────
  2857.   NoteOn(Note:Word; Voice:Byte);
  2858.  
  2859. Turns on a note for voice number [Voice] on the current music-
  2860. device. For Adlib and SoundBlaster, [Voice] must be in the
  2861. range 1..11. If the current music-device happens to be the
  2862. internal speaker, then the [Voice] parameter is of no effect.
  2863. [Note] must be in the range 0..95, corresponding to the keys
  2864. on a piano, with 48 being the "middle-C". There are 12 notes
  2865. per octave. Thus, the total range of 96 notes represents the
  2866. full piano-range of 8 octaves.
  2867.  
  2868.  
  2869. NrOfButtons (Constant)                                  TGK_IO
  2870. ──────────────────────────────────────────────────────────────
  2871.   NrOfButtons : Byte;
  2872.  
  2873. This constant reflects the number of buttons on the mouse, if
  2874. a mousedriver was detected, of course.
  2875.  
  2876.  
  2877. OpenGraphics (Procedure)                              TGK_MAIN
  2878. ──────────────────────────────────────────────────────────────
  2879.  
  2880. Call this procedure before any operation in your program that
  2881. writes to the screen. In general it's good practice to put
  2882. this call right after the initialization-code in your program.
  2883. OpenGraphics will initialize all the necessary variables and
  2884. setup the G∙A∙M∙E graphicsmode.
  2885.  
  2886.  
  2887. OpenWindow (Procedure)                                 TGK_WIN
  2888. ──────────────────────────────────────────────────────────────
  2889.   OpenWindow(Var Window:WindowType; Status:Byte; Pa:Word);
  2890.  
  2891. Will open the window [Window] at page [Pa] at the coordinates
  2892. specified using a previous call to InitWindow. The [Status]
  2893. variable contains information on some window-options. For more
  2894. information on what these are, have a look under WDefault,
  2895. WCloseable and WMoveable.
  2896.  
  2897.  
  2898. Outtext (Procedure)                                   TGK_TEXT
  2899. ──────────────────────────────────────────────────────────────
  2900.   Outtext(X,Y:Integer; Color:Byte; Pa:Word; S:String);
  2901.  
  2902. Will output the string [S] on page [Pa] at position (X,Y),
  2903. using the active font and textsettings. If the active font is
  2904. a mono-font, that is only one color is used, [Color] will be
  2905. used as the color to draw, otherwise, [Color] is of no effect
  2906. and thus a dummy-parameter.
  2907.  
  2908.  
  2909. OuttextHLine (Procedure)                              TGK_TEXT
  2910. ──────────────────────────────────────────────────────────────
  2911.   OuttextHLine(X,Y,YPos:Integer; Color:Byte; 
  2912.                Pa:Word; S:String);
  2913.  
  2914. Will output one single line of the string [S] on page [Pa] at
  2915. position (X,Y+YPos), using the active font and textsettings.
  2916. If the active font is a mono-font, that is only one color is
  2917. used, [Color] will be used as the color to draw, otherwise,
  2918. [Color] is of no effect and thus a dummy-parameter.
  2919.  
  2920.  
  2921. OuttextVLine (Procedure)                              TGK_TEXT
  2922. ──────────────────────────────────────────────────────────────
  2923.   OuttextVLine(X,Y,XPos:Integer; Color:Byte; 
  2924.                Pa:Word; S:String);
  2925.  
  2926. Will output one single row of the string [S] on page [Pa] at
  2927. position (X+XPos,Y), using the active font and textsettings.
  2928. If the active font is a mono-font, that is only one color is
  2929. used, [Color] will be used as the color to draw, otherwise,
  2930. [Color] is of no effect and thus a dummy-parameter.
  2931.  
  2932.  
  2933. OutTextWave (Procedure)                               TGK_TEXT
  2934. ──────────────────────────────────────────────────────────────
  2935.   OutTextWave(X,Y:Integer; Color:Byte; Pa:Word; S:String);
  2936.  
  2937. Works just like OutText, only this time the text will be
  2938. written along the line defined by the last call to SetWave. No
  2939. clipping is performed on the Y-axis and the TextSize-setting
  2940. will be ignored. Instead, the output will always be sized at
  2941. 100%, the default textsize.
  2942.  
  2943.  
  2944. PackData (Function)                                   TGK_FILE
  2945. ──────────────────────────────────────────────────────────────
  2946.   PackData(Var DataIn,DataOut; 
  2947.            NrIn:Word; Var NrOut:Word) : Boolean;
  2948.  
  2949. Will apply Run-Length (RLE) compression on the data pointed to
  2950. by [DataIn] for [NrIn] bytes. The resulting (compressed) data
  2951. will be stored in [DataOut] and the size of this block will be
  2952. returned in [NrOut]. It's good practise to allocate at least
  2953. the same amount of memory for [DataOut] as [DataIn] needed and
  2954. to initialize [NrOut] with the same value [NrIn] has upon
  2955. calling this procedure. Returns false if the data could not be
  2956. compressed, otherwise true. Works best on simple bitmap data
  2957. and the like, not at all on say an executable file.
  2958.  
  2959.  
  2960. PageOffset and PageSegment (Const)                    TGK_MAIN
  2961. ──────────────────────────────────────────────────────────────
  2962.  
  2963. These are two arrays of constants defining the starting ad-
  2964. dresses of each page in videomemory. The PageOffset array
  2965. contains the offset addresses as relative to segment $A000 and
  2966. the PageSegment array contains the absolute segment addresses
  2967. of each page.
  2968.  
  2969.  
  2970. Paint (Procedure)                                       TGK_GP
  2971. ──────────────────────────────────────────────────────────────
  2972.   Paint(X,Y:Integer; Color:Byte; Pa:Word);
  2973.  
  2974. Will do a floodfill starting at (X,Y) on page [Pa], using
  2975. [Color] as the fill-color. Will fill up to any color different
  2976. than the one originally found at (X,Y). Clips to the viewport.
  2977.  
  2978.  
  2979. PaintTo (Procedure)                                     TGK_GP
  2980. ──────────────────────────────────────────────────────────────
  2981.   PaintTo(X,Y:Integer; Color,BackColor:Byte; Pa:Word);
  2982.  
  2983. Will do a floodfill starting at (X,Y) on page [Pa], using
  2984. [Color] as the fill-color. Will fill up to [BackColor]. Clips
  2985. to the viewport.
  2986.  
  2987.  
  2988. PaletteType (Type)                                    TGK_MAIN
  2989. ──────────────────────────────────────────────────────────────
  2990.   PaletteType = Array[0..255] of RGBEntry;
  2991.  
  2992. A type used to store a complete VGA-palette. Used in combina-
  2993. tion with SetPalette and GetPalette.
  2994.  
  2995.  
  2996. PalUpdates (Type)                                     TGK_FILE
  2997. ──────────────────────────────────────────────────────────────
  2998.   PalUpdates = (None,Replace,Remap);
  2999.  
  3000. A type used by the procedure SetPalUpdate to specify one of
  3001. three possible palette-update types. For more information on
  3002. palette-remapping and -updating, have a look at SetPalUpDate.
  3003.  
  3004.  
  3005. PathType (Type)                                       TGK_ANIM
  3006. ──────────────────────────────────────────────────────────────
  3007.   PathType = Record
  3008.               Path     : Pointer;
  3009.               NrPoints : Word;
  3010.               CurPoint : Word;
  3011.              End;
  3012.  
  3013. This type is used to store animation-paths. Animation paths
  3014. can be used to have an animation move along a certain "path"
  3015. which cannot be easily defined through the use of a mathema-
  3016. tical equation. In these cases it's often easier to store the
  3017. path as a number of coordinates, each reflecting a (relative)
  3018. position on screen. [Path] contains a pointer the the actual
  3019. data, [NrPoints] reflects the number of coordinates in this
  3020. path. [CurPoint] is the currently active point and is only
  3021. used by HandleAnimation as sort of a bookmarker.
  3022. Feature versions of G∙A∙M∙E will include a path-editor, allo-
  3023. wing you to create these path-files by simply defining on
  3024. screen what your path will look like and then saving this data
  3025. to disk but as for now you don't really have much use for it.
  3026.  
  3027.  
  3028. PauseMusic (Procedure)                                 TGK_SND
  3029. ──────────────────────────────────────────────────────────────
  3030.  
  3031. Pauses the currently playing FM-Music, if any. May be unpaused
  3032. through a call to StartMusic (with the same piece'o'music as a
  3033. parameter, as was playing before the pause).
  3034.  
  3035.  
  3036. PixelInSprite (Function)                                TGK_BM
  3037. ──────────────────────────────────────────────────────────────
  3038.   PixelInSprite(X,Y:Word; Sprite:SpriteType) : Boolean;
  3039.  
  3040. Return true if the pixel at position (X,Y) is set in [Sprite],
  3041. whereas "set" means this pixel contains a value other than 0
  3042. (which is probably black) or "translucent".
  3043.  
  3044.  
  3045. Poly (Procedure)                                        TGK_GP
  3046. ──────────────────────────────────────────────────────────────
  3047.   Poly(NrPoints:Integer; Var Points; Color:Byte; Pa:Word);
  3048.  
  3049. Draws a polygon using color [Color] on page [Pa], while clip-
  3050. ping to the current viewport. [NrPoints] specifies the number
  3051. of coordinate-pairs in the polygon and [Points] is an untyped
  3052. variable containing an array of (X,Y) coordinate-pairs. Let me
  3053. demonstrate how all this works:
  3054.  
  3055.  Const Form : Array[1..3,1..2] of Integer = 
  3056.                ((100,100),
  3057.                 (150,120),
  3058.                 (110,160));
  3059.  
  3060.  Poly(3,Form,10,0);
  3061.  
  3062. This will draw a (triangular) polygon on page 0, using color
  3063. 10 and the three coordinates as specified in the array [Form].
  3064.  
  3065.  
  3066. PutBlock (Procedure)                                    TGK_BM
  3067. ──────────────────────────────────────────────────────────────
  3068.   PutBlock(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3069.  
  3070. Displays the contents of sprite [Sprite] on page [Pa] on the
  3071. coordinates ([X1],[Y1]). A value of zero in the spritedata
  3072. will NOT be treated as transparent. Thus, all pixels will be
  3073. displayed. This is somewhat faster than PutImage but can only
  3074. be used on backgrounds with one single color or otherwise
  3075. things will look pretty messed up. [Pa] should be in the range
  3076. [0..3]. The sprite will be clipped to the current viewport.
  3077.  
  3078.  
  3079. PutImage (Procedure)                                    TGK_BM
  3080. ──────────────────────────────────────────────────────────────
  3081.   PutImage(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3082.  
  3083. Displays the contents of sprite [Sprite] on page [Pa] on the
  3084. coordinates ([X1],[Y1]). A value of zero in the spritedata
  3085. will be treated as transparent and thus not be displayed. [Pa]
  3086. should be in the range [0..3]. The sprite will be clipped to
  3087. the current viewport.
  3088.  
  3089.  
  3090. PutImageAdd (Procedure)                                 TGK_BM
  3091. ──────────────────────────────────────────────────────────────
  3092.   PutImageAdd(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3093.  
  3094. Works exactly the same as PutImage, only now if a pixel in the
  3095. spritedata is set, it's value will be added to that of the
  3096. corresponding pixel on screen. This mode is used in a lot of
  3097. demonstration programs to create an effect called "shading
  3098. bobs". Don't ask me why they've chosen this name, but hey, it
  3099. sure looks nice... 8^)
  3100.  
  3101.  
  3102. PutImageBrighter (Procedure)                            TGK_BM
  3103. ──────────────────────────────────────────────────────────────
  3104.   PutImageBrighter(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3105.  
  3106. Works exactly the same as PutImage, only now if a pixel in the
  3107. spritedata is set, the corresponding pixel on screen will be
  3108. set to a brighter value, thus creating the effect of a light-
  3109. bundle reflecting on the screen.
  3110. Hint: You could create a sprite formed like a circle and have  
  3111.       it moving over the screen as sort of a spotlight. Looks  
  3112.       pretty nice, especially when using multiple calls to     
  3113.       PutImageBrighter on the same position on screen.
  3114.  
  3115.  
  3116. PutImageDimmer (Procedure)                              TGK_BM
  3117. ──────────────────────────────────────────────────────────────
  3118.   PutImageDimmer(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3119.  
  3120. Works exactly the same as PutImage, only now if a pixel in the
  3121. spritedata is set, the corresponding pixel on screen will be
  3122. set to a dimmer value, thus creating the effect of a shadow. 
  3123.  
  3124.  
  3125. PutImageM (Procedure)                                   TGK_BM
  3126. ──────────────────────────────────────────────────────────────
  3127.   PutImageM(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3128.  
  3129. Puts the image [Sprite] on page [Pa] at the coordinates 
  3130. ([X1],[Y1]), using the mask defined on page 3, the mask page.
  3131. For more info on how this works, have a look at SpriteType and
  3132. PutImageSc.
  3133.  
  3134.  
  3135. PutImageSc (Procedure)                                  TGK_BM
  3136. ──────────────────────────────────────────────────────────────
  3137.   PutImageSc(X1,Y1:Integer; Color:Byte;
  3138.              Sprite:SpriteType; Pa:Word);
  3139.  
  3140. Works exactly the same as PutImage, only this time, all pixels
  3141. in the spritedata that are set, will be displayed on screen in
  3142. color [Color]. This works pretty well in conjunction with the
  3143. mask page for PutImageM and PutRotatedM. Suppose you've drawn
  3144. this (absolutely wonderful) picture of a tree and from now on
  3145. you'd like all your characters to move "behind" that tree
  3146. because, hey, that (absolutely wonderful) tree must be dis-
  3147. played at all times, no matter what...  So what you do is that
  3148. you use PutImageSc to put your image on page 3, the mask page,
  3149. using a value of 4 for [Color] and after that you set the ZPos
  3150. variable for your characters to 5 and use PutImageM to display
  3151. them. Voila, they move behind that tree of yours...
  3152.  
  3153.  
  3154. PutPixel (Procedure)                                    TGK_GP
  3155. ──────────────────────────────────────────────────────────────
  3156.   PutPixel(X,Y:Integer; Color:Byte; Pa:Word);
  3157.  
  3158. Displays a pixel at coordinates (X,Y) in using color [Color]
  3159. on page [Pa]. Clips to the current viewport.
  3160.  
  3161.  
  3162. PutRotated (Procedure)                                  TGK_BM
  3163. ──────────────────────────────────────────────────────────────
  3164.   PutRotated(X,Y,MoveX,MoveY:Integer; Angle:Word;
  3165.              Sprite:SpriteType; Pa:Word);
  3166.  
  3167. Displays the contents of sprite [Sprite] on page [Pa], rotated
  3168. at an angle specified by [Angle]. The Coordinates (X,Y) denote
  3169. the top-left corner of the image. [MoveX] and [MoveY] specify
  3170. the number of pixels the image should be moved from the center
  3171. for respectively the X- and Y-axis. A value of zero in the
  3172. spritedata will be treated as transparent and thus not be
  3173. displayed. [Pa] should be in the range [0..3]. The sprite will
  3174. NOT be clipped to the current viewport so take care when
  3175. putting images on screen this way, as they will wrap-around
  3176. the edges of the screen.
  3177.  
  3178.  
  3179. PutScaled (Procedure)                                   TGK_BM
  3180. ──────────────────────────────────────────────────────────────
  3181.   PutScaled(X1,Y1:Integer; Centered:Boolean; Size:Word;
  3182.             Sprite:SpriteType; Pa:Word);
  3183.  
  3184. Displays the contents of sprite [Sprite] on page [Pa], scaled
  3185. to the size specified by [Size], where [Size] is in percents.
  3186. If Centered is true, the image will be centered around the
  3187. (X1,Y1) coordinates, otherwise these coordinates denote the
  3188. top-left corner of the image, as with the normal PutImage. A
  3189. value of zero in the spritedata will be treated as transparent
  3190. and thus not be displayed. [Pa] should be in the range [0..3].
  3191. The sprite will be clipped to the current viewport.
  3192.  
  3193.  
  3194. PutScaledM (Procedure)                                  TGK_BM
  3195. ──────────────────────────────────────────────────────────────
  3196.   PutScaledM(X1,Y1:Integer; Centered:Boolean; Size:Word;
  3197.              Sprite:SpriteType; Pa:Word);
  3198.  
  3199. Puts the image [Sprite] on page [Pa] at the coordinates 
  3200. (X1,Y1), using the mask defined on page 3, the mask page,
  3201. scaled to the size specified by [Size]. The image can option-
  3202. ally be centered around (X1,Y1) when [Centered] is set to
  3203. true. For more info on how this works, have a look at Sprite-
  3204. Type and PutImageSc.
  3205.  
  3206.  
  3207. PutScaledSc (Procedure)                                 TGK_BM
  3208. ──────────────────────────────────────────────────────────────
  3209.   PutScaledSc(X1,Y1:Integer; Centered:Boolean; Color:Byte;
  3210.               Size:Word; Sprite:SpriteType; Pa:Word);
  3211.  
  3212. Works exactly the same as PutScaled only now with the same
  3213. side-effects as PutImageSc. For more info, read about PutSca-
  3214. led and PutImageSc.
  3215.  
  3216.  
  3217. PutWave (Procedure)                                     TGK_BM
  3218. ──────────────────────────────────────────────────────────────
  3219.   PutWave(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3220.  
  3221. Displays the contents of sprite [Sprite] on page [Pa] on the
  3222. coordinates (X1,Y1), using the waveform specified through a
  3223. previous call to SetWave. A value of zero in the spritedata
  3224. will be treated as transparent and thus not be displayed. [Pa]
  3225. should be in the range [0..3]. The sprite will be clipped to
  3226. the current viewport.
  3227.  
  3228.  
  3229. PutWaveSC (Procedure)                                   TGK_BM
  3230. ──────────────────────────────────────────────────────────────
  3231.   PutWaveSC(X1,Y1:Integer; Sprite:SpriteType; Pa:Word);
  3232.  
  3233. Works exactly the same as the PutImageSC procedure, only this
  3234. time the waveform specified through a previous call to SetWave
  3235. will be used.
  3236.  
  3237.  
  3238. QuestionWindow (Function)                              TGK_WIN
  3239. ──────────────────────────────────────────────────────────────
  3240.   QuestionWindow(X,Y,Pa:Word; Question:String) : Boolean;
  3241.  
  3242. Pops up a question-window (Yes/No) at (X,Y) on page [Pa]. The
  3243. question you want to ask the user must be in [Question]. The
  3244. result is returned as a boolean, but two constants, Yes and No
  3245. have been defined to program something like this:
  3246.  
  3247.  If QuestionWindow(20,20,0,'Do you like Femke?')=Yes
  3248.   then MessageWindow(50,50,0,'Great, so do I...')
  3249.  else MessageWindow(50,50,0,'Get A Life!');
  3250.  
  3251.  Hint: You answer should have been YES!
  3252.  
  3253.  
  3254. Raster (Variable)                                     TGK_MAIN
  3255. ──────────────────────────────────────────────────────────────
  3256.   Raster = Array[1..20] of RasterType;
  3257.  
  3258. This array holds the twenty available raster-definitions. Do
  3259. not alter it directly but only through the use of SetUserRas-
  3260. ter. For an example on how this is done, have a look at the
  3261. RasterType description.
  3262.  
  3263.  
  3264. RasterType (Type)                                     TGK_MAIN
  3265. ──────────────────────────────────────────────────────────────
  3266.   RasterType = Array[0..31] of Byte;
  3267.  
  3268. This type is used to store a single raster-description. Used
  3269. in combination with SetUserRaster to set one of the twenty
  3270. available user-rasters. A raster is merely an array of colors
  3271. describing what the raster will look like once used as a
  3272. fillstyle. Thus, to create a raster sliding from lightred to
  3273. darkred and back, one could use code like this:
  3274.  
  3275. Var MyRaster : RasterType;
  3276.     A        : Byte;
  3277.  
  3278.  For A:=0 to 15 do
  3279.   Begin
  3280.    MyRaster[A]:=32+A;
  3281.    MyRaster[31-A]:=32+A;
  3282.   End;
  3283.  SetUserRaster(1,MyRaster);
  3284.  
  3285.  
  3286. ReadKey (Function)                                      TGK_IO
  3287. ──────────────────────────────────────────────────────────────
  3288.   ReadKey : Char;
  3289.  
  3290. Reads a key from the keyboard buffer or, if no key is availa-
  3291. ble, waits until the user presses a key. 
  3292.  
  3293.  
  3294. Rectangle (Procedure)                                   TGK_GP
  3295. ──────────────────────────────────────────────────────────────
  3296.   Rectangle(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  3297.  
  3298. Draws a rectangle on page [Pa], using color [Color]. The
  3299. coordinate-pair (X1,Y1) denotes the upperleft corner of the
  3300. rectangle, whereas (X2,Y2) denotes the lowerright corner.
  3301. Clips to the current viewport.
  3302.  
  3303.  
  3304. Resource (Variable)                                   TGK_FILE
  3305. ──────────────────────────────────────────────────────────────
  3306.   Resource : String;
  3307.  
  3308. By default this string will be empty. If the programmer chan-
  3309. ges it, however, all file-handling routines will search for
  3310. their files in the resource-file specified by this string. If
  3311. a certain file is not found in the resource, the file-handling
  3312. rountines will continue looking for it as a stand-alone file.
  3313. For more information on how resources work, have a look at the
  3314. description of the MAKERES program, as discussed in chapter 4,
  3315. paragraph 4.5.
  3316.  
  3317.  
  3318. RestoreFillStyle (Procedure)                            TGK_GP
  3319. ──────────────────────────────────────────────────────────────
  3320.   RestoreFillStyle(Style:Byte);
  3321.  
  3322. Restores a previously saved FillStyle from [Style].
  3323.  
  3324.  
  3325. RGBEntry (Type)                                       TGK_MAIN
  3326. ──────────────────────────────────────────────────────────────
  3327.   RGBEntry = Record
  3328.               R,G,B : Byte;
  3329.              End;
  3330.  
  3331. This type is used to define one entry in a PaletteType, with
  3332. the R,G and B entries specifying the red, green and blue
  3333. components.
  3334.  
  3335.  
  3336. RightButton (Function)                                  TGK_IO
  3337. ──────────────────────────────────────────────────────────────
  3338.   RightButton : Boolean;
  3339.  
  3340. Returns true if the right mousebutton is currently down.
  3341.  
  3342.  
  3343. RightText (Const)                                     TGK_TEXT
  3344. ──────────────────────────────────────────────────────────────
  3345.   RightText = 2;
  3346.  
  3347. Used in conjunction with SetTextJustify, for more information
  3348. on how this procedure works, have a look under the appropriate
  3349. header.
  3350.  
  3351.  
  3352. RotateObject (Procedure)                                TGK_3D
  3353. ──────────────────────────────────────────────────────────────
  3354.   RotateObject(Nr:Word; RX,RY,RZ:Integer);
  3355.  
  3356. Rotates vector-object [Nr] for [RX], [RY] and [RZ] degrees
  3357. along the respective axes.
  3358.  
  3359.  
  3360. RShiftPressed (Function)                                TGK_IO
  3361. ──────────────────────────────────────────────────────────────
  3362.   RShiftPressed : Boolean;
  3363.  
  3364. Returns true if the Right Shift-Key is currently being pres-
  3365. sed.
  3366.  
  3367.  
  3368. SampleType (Type)                                      TGK_SND
  3369. ──────────────────────────────────────────────────────────────
  3370.   SampleType = Record
  3371.                 SampleStopped : Boolean;
  3372.                 { Plus lots of uninteresting stuff...}
  3373.                End;
  3374.  
  3375. This type is used by the various digital-sound-playback routi-
  3376. nes found in TGK_SND. The only interesting field is [Sample-
  3377. Stopped], which can be used to check whether a sample is
  3378. currently playing or not. This may come in handy if you want
  3379. to start a new sample right after the old one has stopped.
  3380.  
  3381.  
  3382. SaveFillStyle (Procedure)                               TGK_GP
  3383. ──────────────────────────────────────────────────────────────
  3384.   SaveFillStyle(Var Style:Byte);
  3385.  
  3386. Saves the current fillstyle in [Style]. 
  3387.  
  3388.  
  3389. SaveGPF (Procedure)                                   TGK_FILE
  3390. ──────────────────────────────────────────────────────────────
  3391.   SaveGPF(FileName:String; Pa:Word);
  3392.  
  3393. Will save a GPF (G∙A∙M∙E-Picture File) file to disk. Storing
  3394. the contents of page [Pa] in a file named [FileName]. If no
  3395. extension is specified, the default extension, .GPF will be
  3396. used.
  3397.  
  3398.  
  3399. SaveImage (Procedure)                                 TGK_FILE
  3400. ──────────────────────────────────────────────────────────────
  3401.   SaveImage(FileName:String; Sprite:SpriteType);
  3402.  
  3403. Saves the contents of the sprite [Sprite] to a file named
  3404. [FileName]. [Sprite] must have been previously initialized and
  3405. preferably contain useful data ;-)  If no extension is speci-
  3406. fied, the default extension, .GSF will be used.
  3407.  
  3408.  
  3409. SBInstalled (Const)                                    TGK_SND
  3410. ──────────────────────────────────────────────────────────────
  3411.   SBInstalled : Boolean;
  3412.  
  3413. [SBInstalled] will be set to true if a Soundblaster-Compatible
  3414. soundcard was found in your system. Otherwise, it will be set
  3415. to false.
  3416.  
  3417.  
  3418. ScrollPage                                              TGK_GP
  3419. ──────────────────────────────────────────────────────────────
  3420.   ScrollPage(Page:Byte; Dir:Direction; Pixels,Color:Byte);
  3421.  
  3422. Scrolls page [Page] in the direction specified by [Dir]. The
  3423. number of pixels to be scrolled is specified by [Pixels] and
  3424. the color to use to fill the part that scrolls in by [Color].
  3425. [Dir] is of type Direction. For more info in this type, look
  3426. under the appropriate header.
  3427.  
  3428.  
  3429. SetBlackPal (Procedure)                               TGK_MAIN
  3430. ──────────────────────────────────────────────────────────────
  3431.  
  3432. This procedure will set the entire palette to black.
  3433.  
  3434.  
  3435. SetColor (Procedure)                                  TGK_MAIN
  3436. ──────────────────────────────────────────────────────────────
  3437.   SetColor(Nr:Byte; Entry:RGBEntry);
  3438.  
  3439. Sets the red, green and blue values for entry [Nr] of the
  3440. palette. For example, to set color number 10 to deep purple,
  3441. one could use code similar to:
  3442.  
  3443. Var MyEntry : RGBEntry;
  3444.  
  3445.  With MyEntry do 
  3446.   Begin
  3447.    R:=63;
  3448.    G:=0;
  3449.    B:=63;
  3450.   End;
  3451.  SetColor(10,MyEntry);
  3452.  
  3453.  
  3454. SetColorPal (Procedure)                               TGK_MAIN
  3455. ──────────────────────────────────────────────────────────────
  3456.   SetColorPal(Color:Byte);
  3457.  
  3458. This procedure will set the entire palette to the color speci-
  3459. fied in [Color]. [Color], however, is one of the 256 palette
  3460. entries and thus a variable value. If you would like to be
  3461. sure you will set the entire palette to blue, use some code
  3462. like this:
  3463.  
  3464. Var Entry : RGBEntry;
  3465.  
  3466.  With Entry do
  3467.   Begin
  3468.    R:=0;
  3469.    G:=0;
  3470.    B:=63;
  3471.   End;
  3472.  SetColor(1,Entry);
  3473.  SetColorPal(1);
  3474.  
  3475.  
  3476. SetDACDevice (Procedure)                               TGK_SND
  3477. ──────────────────────────────────────────────────────────────
  3478.   SetDACDevice(Device:SoundDevice);
  3479.  
  3480. Sets the active digital-sound playback-device to [Device],
  3481. which must be one of the these:
  3482.  
  3483.   · Speaker
  3484.   · Adlib
  3485.   · SoundBlaster
  3486.   · Covox
  3487.  
  3488. Adlib and SoundBlaster will only work if the appropriate
  3489. hardware is installed in your computer. A Covox device cannot
  3490. be detected and should be handled with care. The port-number
  3491. for a covox device can be specified using SetDACPort.
  3492.  
  3493.  
  3494. SetDACPort (Procedure)                                 TGK_SND
  3495. ──────────────────────────────────────────────────────────────
  3496.   SetDACPort(PortNr:Word);
  3497.  
  3498. Sets the port number to use for Covox digital-sound playback
  3499. to [PortNr]. By default it is set to $300, the base address
  3500. for a prototype expansion-card. If [PortNr] is in the range
  3501. 1..4, the address will be set to that of the corresponding
  3502. printerport (LPT1..LPT4) as found in the BIOS data-area,
  3503. otherwise, the absolute number specified will be used.
  3504.  
  3505.  
  3506. SetDefaultWindowColors (Procedure)                     TGK_WIN
  3507. ──────────────────────────────────────────────────────────────
  3508.  
  3509. Sets the default color selection for the windows.
  3510.  
  3511.  
  3512. SetFillStyle (Procedure)                                TGK_GP
  3513. ──────────────────────────────────────────────────────────────
  3514.   SetFillStyle(Style:Byte);
  3515.  
  3516. Sets the current fillstyle. [Style] can be one of these:
  3517.  
  3518.    0      · Standard Single-Color/Solid
  3519.    1..20  · Horizontal Raster
  3520.   21..40  · Vertical Raster
  3521.   41..44  · Patterned/Translucent
  3522.   45..60  · User defined patterns (16x16)
  3523.   61      · Brighter
  3524.   62      · Dimmer
  3525.   63      · Xor
  3526.   64      · Zero
  3527.  
  3528. The Horizontal and Vertical raster-fills can be changed using
  3529. the SetUserRaster procedure. The Patterned/Translucent fills
  3530. can be changed using the SetUserMask procedure. Finally, The
  3531. User defined patterns can be changed using the SetUserFill
  3532. procedure. Just try all of the different fillstyles to get an
  3533. idea on how they work.
  3534.  
  3535.  
  3536. SetFont (Procedure)                                   TGK_TEXT
  3537. ──────────────────────────────────────────────────────────────
  3538.   SetFont(Nr:Byte);
  3539.  
  3540. Sets the active font to the one specified in [Nr]. [Nr] must
  3541. be in the range 0..5, where 0 reflects the internal font and
  3542. 1..5 any of the user-loadable fonts. If no font has been
  3543. previously loaded into the slot specified, SetFont won't do
  3544. anything and the current font remains the active one.
  3545.  
  3546.  
  3547. SetInstrument (Procedure)                              TGK_SND
  3548. ──────────────────────────────────────────────────────────────
  3549.   SetInstrument(Voice:Byte; Var Ins);
  3550.  
  3551. Sets the instrument for voice number [Voice] to [Ins]. [Ins]
  3552. must be an array of 12 bytes containing the instrument data.
  3553. The format used here is the same as in the standard SoundBlas-
  3554. ter-instrument-files, the [.SBI]-files. For more information
  3555. on this format please consult some document or maybe a book on
  3556. SoundBlaster programming.
  3557.  
  3558.  
  3559. SetMode (Procedure)                                    TGK_SND
  3560. ──────────────────────────────────────────────────────────────
  3561.   SetMode(Mode:ModeType);
  3562.  
  3563. Sets the mode of an Adlib- or a SoundBlaster-card to either
  3564. Melodic or Percussive. In Melodic mode, these cards are capa-
  3565. ble of playing music in 9 melodic voices. In the Percussive
  3566. mode, there are 6 melodic voices and 5 percussive voices. You
  3567. must really know quite a lot about these cards to completely
  3568. understand what this procedure does; If you don't -- just
  3569. don't use the procedure, you'll manage fine without it 8-)
  3570.  
  3571.  
  3572. SetMouse (Procedure)                                    TGK_IO
  3573. ──────────────────────────────────────────────────────────────
  3574.   SetMouse(X,Y:Integer);
  3575.  
  3576. Sets the mousecursor to the position specified by the [X] and
  3577. [Y] variables. Clips to the mouse-boundaries.
  3578.  
  3579.  
  3580. SetMouseCursor (Procedure)                              TGK_IO
  3581. ──────────────────────────────────────────────────────────────
  3582.   SetMouseCursor(Shape:MouseStruct);
  3583.  
  3584. Sets the mousecursor to the shape defined in [Shape]. [Shape]
  3585. if of type MouseStruct. For a more detailed description of
  3586. this type, have a look at MouseStruct.
  3587.  
  3588.  
  3589. SetMouseRange (Procedure)                               TGK_IO
  3590. ──────────────────────────────────────────────────────────────
  3591.   SetMouseRange(X1,Y1,X2,Y2:Word);
  3592.  
  3593. Sets the mouse-boundaries to the rectangular area specified by
  3594. [X1], [Y1], [X2] and [Y2]. Clips to the screen boundaries.
  3595.  
  3596.  
  3597. SetMouseSensivity (Procedure)                           TGK_IO
  3598. ──────────────────────────────────────────────────────────────
  3599.   SetMouseSensivity(Hr,Vr:Integer);
  3600.  
  3601. Mouse-sensivity is the number of pixels the mousecursor will
  3602. move in relation to the actual mouse-movement. [Hr] specifies
  3603. the horizontal ratio and [Vr] the vertical ratio. The higher
  3604. the value, the more the cursor will move in relation to your
  3605. mouse-movements.
  3606.  
  3607.  
  3608. SetMouseSettings (Procedure)                            TGK_IO
  3609. ──────────────────────────────────────────────────────────────
  3610.   SetMouseSettings(MouseInfo:MouseSettingsType);
  3611.  
  3612. Restores the mousesettings from a previously saved [MousInfo]
  3613. record. For a more detailed description of the [MouseInfo]
  3614. record have a look at MouseSettingsType.
  3615.  
  3616.  
  3617. SetMusicDevice (Procedure)                             TGK_SND
  3618. ──────────────────────────────────────────────────────────────
  3619.   SetMusicDevice(Device:SoundDevice);
  3620.  
  3621. Sets the active FM-Music playback-device to [Device], which
  3622. must be one of the these:
  3623.  
  3624.   · Speaker
  3625.   · Adlib
  3626.   · SoundBlaster
  3627.  
  3628. Adlib and SoundBlaster will only work if the appropriate
  3629. hardware is installed in your computer. When MusicDevice is
  3630. set to Speaker, music playback may sound weird at times ;-)
  3631.  
  3632.  
  3633. SetOrigin (Procedure)                                   TGK_3D
  3634. ──────────────────────────────────────────────────────────────
  3635.   SetOrigin(Nr:Word; X,Y:Integer);
  3636.  
  3637. Sets the position on screen for vector-object [Nr] to (X,Y).
  3638.  
  3639.  
  3640. SetOverallVolume (Procedure)                           TGK_SND
  3641. ──────────────────────────────────────────────────────────────
  3642.   SetOverallVolume(Vol:Real);
  3643.  
  3644. Sets the overall volume of the Adlib- and Soundblaster-cards
  3645. for the playback of FM-Music to [Vol]. [Vol] must be in the
  3646. range 0.0..1.0 with 1.0 being the loudest. 
  3647.  
  3648. Hint: Nice for fading effects on music and sound-effects!
  3649.  
  3650.  
  3651. SetPage (Procedure)                                   TGK_MAIN
  3652. ──────────────────────────────────────────────────────────────
  3653.   SetPage(Pa:Word);
  3654.  
  3655. This procedure sets the active display page. The parameter
  3656. [Pa] should be in the range [0..3].
  3657.  
  3658.  
  3659. SetPalette (Procedure)                                TGK_MAIN
  3660. ──────────────────────────────────────────────────────────────
  3661.   SetPalette(Var Palette);
  3662.  
  3663. Uses the structure in [Palette] to set the current palette.
  3664. [Palette] being an untyped variable, we can actually use any
  3665. structure as a palette. However, it is good practice to use
  3666. the G∙A∙M∙E PaletteType. 
  3667.  
  3668.  
  3669. SetPalUpdate (Procedure)                              TGK_FILE
  3670. ──────────────────────────────────────────────────────────────
  3671.   SetPalUpdate(UpDate:PalUpdates);
  3672.  
  3673. Changes the palette-updating/remapping method used when loa-
  3674. ding images from disk to one of the following:
  3675.  
  3676.      · None           The palette will never be updated when
  3677.                       loading images from disk. This is the
  3678.                       default setting. As a result, images may
  3679.                       appear in the wrong colors.
  3680.  
  3681.      · Replace        Palette information will be loaded from
  3682.                       the image and the new palette will be
  3683.                       set. Images will always appear correctly
  3684.                       but other information on screen might
  3685.                       appear in the wrong colors.
  3686.  
  3687.      · Remap          The colors used in the image will be 
  3688.                       remapped to appear close to those used
  3689.                       in the current palette. Images may look
  3690.                       like they've been sanbathing too long or
  3691.                       maybe like they didn't sleep that well, 
  3692.                       but at least, the old palette info is
  3693.                       retained.
  3694.  
  3695. Each of these methods has it's benefits. [None] is fast,
  3696. [Replace] accurate and [Remap] may be a good alternative...
  3697.  
  3698.  
  3699. SetProportional (Procedure)                           TGK_TEXT
  3700. ──────────────────────────────────────────────────────────────
  3701.   SetProportional(Proportional:Boolean);
  3702.  
  3703. When set to true, characters in a printed string occupy an
  3704. amount of space relative to their horizontal size. Otherwise,
  3705. all characters occupy an equal number of pixels, regardless of
  3706. their actual width.
  3707.  
  3708.  
  3709. SetSampleSpeed (Procedure)                             TGK_SND
  3710. ──────────────────────────────────────────────────────────────
  3711.   SetSampleSpeed(Speed:Word);
  3712.  
  3713. Sets the playback-speed for digital-sounds in [Speed] bytes
  3714. per second. The default setting is 10000. Some sample require
  3715. different speeds, however. It is also possible to change the
  3716. pitch of a sample by varying the playback-speed. This way,
  3717. some pretty neat effects can be achieved.
  3718.  
  3719.  
  3720. SetSpacing (Procedure)                                TGK_TEXT
  3721. ──────────────────────────────────────────────────────────────
  3722.   SetSpacing(Space:Byte);
  3723.  
  3724. [Space] reflects the number of blank pixels G∙A∙M∙E will add
  3725. in between each printed character. The default setting is 2,
  3726. however for some larger fonts, a setting of 3 or 4 may be more
  3727. appropriate.
  3728.  
  3729.  
  3730. SetSpecialRange (Procedure)                             TGK_IO
  3731. ──────────────────────────────────────────────────────────────
  3732.   SetSpecialRange(X1,Y1,X2,Y2:Integer);
  3733.  
  3734. Sets the rectangular area in which the mousecursor will NOT be
  3735. visible to the coordinates specified by [X1], [Y1], [X2] and
  3736. [Y2]. Will clip to the screen boundaries.
  3737.  
  3738.  
  3739. SetTextJustify (Procedure)                            TGK_TEXT
  3740. ──────────────────────────────────────────────────────────────
  3741.   SetTextJustify(Horizontal,Vertical:Byte);
  3742.  
  3743. Sets the horizontal and vertical text justification. For the
  3744. [Horizontal] parameter, the values LeftText, CenterText and
  3745. RightText are possible, for the [Vertical] parameter, one can
  3746. use BottomText, CenterText and TopText. Using the following
  3747. diagram, I will show you how each of these parameters affects
  3748. the way in which text is being displayed:
  3749.  
  3750.  
  3751.      Horizontal:
  3752.  
  3753.   left center right
  3754.                       Vertical:
  3755.    │LOT  LOT  LOT│
  3756.  ──┼──────┼──────┼──  bottom
  3757.    │      │      │
  3758.  ──┼LOT──LOT──LOT┼──  center
  3759.    │      │      │
  3760.  ──┼──────┼──────┼──  top
  3761.    │LOT  LOT  LOT│
  3762.  
  3763.  
  3764. SetTextMode (Procedure)                               TGK_TEXT
  3765. ──────────────────────────────────────────────────────────────
  3766.   SetTextMode(Mode:TextModeType);
  3767.  
  3768. Sets the textmode to either Speed or Precision. When [Mode] is
  3769. set to Speed, integer math will be used when calculating text-
  3770. positions on screen. When set to Precision, real math will be
  3771. used, giving better results but being somewhat slower. 
  3772.  
  3773.  
  3774. SetTextSettings (Procedure)                           TGK_TEXT
  3775. ──────────────────────────────────────────────────────────────
  3776.   SetTextSettings(Settings:TextSettingsType);
  3777.  
  3778. Restores previously saved textsettings. For more information
  3779. on which textsettings are affected, please have a look at the
  3780. GetTextSettings procedure, as discussed under it's header.
  3781.  
  3782.  
  3783. SetTextSize (Procedure)                               TGK_TEXT
  3784. ──────────────────────────────────────────────────────────────
  3785.   SetTextSize(Size:Word);
  3786.  
  3787. Sets the textsize to [Size] percents. Thus, all values within
  3788. the range 1..99 will produce characters smaller than the
  3789. normal size, 100 is the normal size and any value greater than
  3790. 100 will produce larger characters than normal.
  3791.  
  3792.  
  3793. SetupAnimation (Procedure)                            TGK_ANIM
  3794. ──────────────────────────────────────────────────────────────
  3795.   SetupAnimation(Var Animation:AnimType;
  3796.                  X,Y:Integer; Mode:AnimMode);
  3797.  
  3798. Sets the animation specified in [Animation] to the (X,Y)-
  3799. position on screen denoted to by [X] and [Y], and sets it's
  3800. animation-mode to [Mode]. For a complete description of all
  3801. animation-modes, have a look at AnimMode.
  3802.  
  3803.  
  3804. SetUserFill (Procedure)                                 TGK_GP
  3805. ──────────────────────────────────────────────────────────────
  3806.   SetUserFill(Nr:Byte; Var FillData);
  3807.  
  3808. Sets the user-fillstyle [Nr]. [Nr] must be in the range 1..16,
  3809. corresponding to the fillstyles 45..60 as discussed under
  3810. SetFillStyle. [FillData] is a 16x16 array, containing the
  3811. bitmap-info. This is discussed in greater detail under the
  3812. header FillPatType.
  3813.  
  3814.  
  3815. SetUserMask (Procedure)                                 TGK_GP
  3816. ──────────────────────────────────────────────────────────────
  3817.   SetUserMask(Nr,OddMask,EvenMask:Byte);
  3818.  
  3819. Sets the user-definable patternfill [Nr]. [Nr] must be in the
  3820. range 1..4, corresponding to the fillstyles 41..44 as discus-
  3821. sed under SetFillStyle. [OddMask] and [EvenMask] must both be
  3822. in the range 0..15 and should be regarded as a binary number
  3823. specifying what the pattern will look like on screen for the
  3824. odd and even lines respectively. For example if [OddMask] is
  3825. given a value of 5 (0101) and [EvenMask] a value of 10 (1010),
  3826. the resulting pattern on screen will look like this:
  3827.  
  3828.   Line 0  101010101010
  3829.   Line 1  010101010101
  3830.   Line 2  101010101010 Etc. 
  3831.  
  3832. Zero-bits will be translucent.
  3833.  
  3834.  
  3835. SetUserRaster (Procedure)                               TGK_GP
  3836. ──────────────────────────────────────────────────────────────
  3837.   SetUserRaster(Nr:Byte; Var RasterData);
  3838.  
  3839. Sets the raster colors for raster number [Nr]. [Nr] must be in
  3840. the range [1..20], corresponding to the fillstyle 1..20 and
  3841. 21..40 as discussed under SetFillStyle. [RasterData] is of
  3842. type RasterType and contains an array of 32 color-values,
  3843. specifying the color number to use for each rasterline. Just
  3844. fiddle around with this to see how it works...
  3845.  
  3846.  
  3847. SetViewPort (Procedure)                               TGK_MAIN
  3848. ──────────────────────────────────────────────────────────────
  3849.   SetViewPort(X1,Y1,X2,Y2:Integer);
  3850.  
  3851. SetViewPort specifies the rectangular area on screen to which
  3852. all output will be redirected to the one specified by the
  3853. coordinate-pairs (X1,Y1)-(X2,Y2).
  3854.  
  3855.  
  3856. SetVolume (Procedure)                                  TGK_SND
  3857. ──────────────────────────────────────────────────────────────
  3858.   SetVolume(Voice:Byte; Vol:Real);
  3859.  
  3860. Sets the relative volume of voice [Voice] on the Adlib-
  3861. and Soundblaster-cards to [Vol], which must be in the range
  3862. 0.0..1.0 with 1.0 being the loudest. 
  3863.  
  3864. Hint: Nice for fading effects on music and sound-effects!
  3865.  
  3866.  
  3867. SetWave (Procedure)                                     TGK_BM
  3868. ──────────────────────────────────────────────────────────────
  3869.   SetWave(Wave:WaveType);
  3870.  
  3871. This procedure is used to specify a list of (what I call) "Y-
  3872. Offset-Values" for the procedures PutWave, PutWaveSC and
  3873. OutTextWave. [Wave] contains the Y-Offset for each of the 320
  3874. columns on screen. By filling [Wave] using a sine-function or
  3875. so, one can really create "fuzzy" effects. Here's a nice one:
  3876.  
  3877.  Var MyWave : WaveType;
  3878.      A      : Word;
  3879.  
  3880.   For A:=0 to 319 do
  3881.    MyWave[A]:=Round(Sin(A/(Pi*4.05))*20);
  3882.  SetWave(MyWave);
  3883.  
  3884.  
  3885. SetWhitePal (Procedure)                               TGK_MAIN
  3886. ──────────────────────────────────────────────────────────────
  3887.  
  3888. This procedure will set the entire palette to white.
  3889.  
  3890.  
  3891. SetWindowColors (Procedure)                            TGK_WIN
  3892. ──────────────────────────────────────────────────────────────
  3893.   SetWindowColors(ColorSet:WindowColorSet);
  3894.  
  3895. Sets the color selection for the windows. For a more detailed
  3896. explanation, look under WindowColorSet.
  3897.  
  3898.  
  3899. ShiftPressed (Function)                                 TGK_IO
  3900. ──────────────────────────────────────────────────────────────
  3901.   ShiftPressed : Boolean;
  3902.  
  3903. Returns true if either of the two Shift-Keys is currently
  3904. being pressed.
  3905.  
  3906.  
  3907. ShowPage (Procedure)                                  TGK_MAIN
  3908. ──────────────────────────────────────────────────────────────
  3909.   ShowPage(Pa:Word);
  3910.  
  3911. A call to ShowPage will copy the contents of page [Pa] to the
  3912. active display page. [Pa] should be in the range [0..3].
  3913.  
  3914.  
  3915. SizeObject (Procedure)                                  TGK_3D
  3916. ──────────────────────────────────────────────────────────────
  3917.   SizeObject(Nr:Word; R:Real);
  3918.  
  3919. Multiplies all of the points in vector-object [Nr] by [R].
  3920. Thus a value of 0.5 for [R] will cause the object to become
  3921. twice as small.
  3922.  
  3923.  
  3924. SlideButtonResult (Function)                           TGK_WIN
  3925. ──────────────────────────────────────────────────────────────
  3926.   SlideButtonResult(Window:WindowType; Nr:Word) : Word;
  3927.  
  3928. Returns the current value for button number [Nr] on window
  3929. [Window], a button of type slidebutton. For a programming
  3930. example, look under CheckButtonResult.
  3931.  
  3932.  
  3933. SoundDevice (Type)                                     TGK_SND
  3934. ──────────────────────────────────────────────────────────────
  3935.   SoundDevice = (Speaker,Adlib,SoundBlaster,Covox);
  3936.  
  3937. This type is used by the procedures SetMusicDevice and SetDAC-
  3938. Device to specify the type of sound-device to use. Also, the
  3939. constants MusicDevice and DACDevice use this type to reflect
  3940. the current devices for music- and digital-sound-playback.
  3941.  
  3942.  
  3943. Spline (Procedure)                                      TGK_GP
  3944. ──────────────────────────────────────────────────────────────
  3945.   Spline(NrPoints:Word; Var CurveData; Color:Byte; Pa:Word);
  3946.  
  3947. Will draw the most flowing line between the number coordinates
  3948. specified by [NrPoints] on page [Pa], using [Color] as the
  3949. drawing-color. [CurveData] contains an array of (X,Y)-coordi-
  3950. nate pairs. The principle here is the same as used in Poly and
  3951. FPoly. For more info on how these arrays containing coordinate
  3952. pairs work, have a look over there.
  3953.  
  3954.  
  3955. SpriteHeight (Function)                                 TGK_BM
  3956. ──────────────────────────────────────────────────────────────
  3957.   SpriteHeight(Sprite:SpriteType; Size:Word):Word;
  3958.  
  3959. Returns the height of sprite [Sprite] in pixels for the size
  3960. specified in [Size], where [Size] is in percents. Could, for
  3961. example, be used to center sprites on screen on the Y-Axis.
  3962.  
  3963.  
  3964. SpriteType (Type)                                       TGK_BM
  3965. ──────────────────────────────────────────────────────────────
  3966.   SpriteType = Record
  3967.                 Sprite : Pointer;
  3968.                 Size   : Word;
  3969.                 ZPos   : Byte;
  3970.                End;
  3971.  
  3972. This is a type used to denote any sprite you use in your
  3973. programs. [Sprite] contains the actual data, or Nil if no data
  3974. has been assigned. [Size] is the size of [Sprite] in bytes or
  3975. zero if no data had been assigned. [ZPos] is the "z-position"
  3976. of the sprite on screen. This variable is used in combination
  3977. with the PutImageM and PutScaledM procedures to specify on
  3978. which level the sprite will be drawn. There are 256 levels in
  3979. total. If, for example, [ZPos]=10 for a certain sprite and
  3980. PutImageM is called, the sprite will only be visible for those
  3981. parts of the mask page smaller than or equal to 10. The mask
  3982. page is always page 3. If you would draw a filled rectangle on
  3983. page 3 like this: FRectangle(160,0,319,199,2,3), then the
  3984. sprite would only be visible on the left half of the screen
  3985. for [ZPos]<2. Thus, you could create a complete mask for any
  3986. picture you may have on your visible page, allowing an object
  3987. to move "behind" certain parts of that picture and "in front"
  3988. of other parts.
  3989.  
  3990.  
  3991. SpriteWidth (Function)                                  TGK_BM
  3992. ──────────────────────────────────────────────────────────────
  3993.   SpriteWidth(Sprite:SpriteType; Size:Word):Word;
  3994.  
  3995. Returns the width of sprite [Sprite] in pixels for the size
  3996. specified in [Size], where [Size] is in percents. Could, for
  3997. example, be used to center sprites on screen on the X-Axis.
  3998.  
  3999.  
  4000. Square (Procedure)                                      TGK_GP
  4001. ──────────────────────────────────────────────────────────────
  4002.   Square(X1,Y1,Size:Integer; Color:Byte; Pa:Word);
  4003.  
  4004. Draws a square on page [Pa], using color [Color]. The coordi-
  4005. nate-pair (X1,Y1) denotes the upperleft corner of the square,
  4006. whereas (X1+Size,Y1+Size) denotes the lowerright corner. Clips
  4007. to the current viewport.
  4008.  
  4009.  
  4010. Standard_Palette (Const)                              TGK_MAIN
  4011. ──────────────────────────────────────────────────────────────
  4012.  
  4013. This is actually a procedure, but should NEVER be called. It's
  4014. merely defined as a procedure to allow it to be placed in the
  4015. code-segment. Contains a table with default color values. Set
  4016. as the default palette by G∙A∙M∙E upon startup.
  4017.  
  4018.  
  4019. StartMusic (Procedure)                                 TGK_SND
  4020. ──────────────────────────────────────────────────────────────
  4021.   StartMusic (Var MusicData:MusicType; Times:Byte);
  4022.  
  4023. Starts playback of the musical-score stored in [MusicData], if
  4024. any, that is, through the active MusicDevice. You've guessed
  4025. it already; [Times] specifies the number of times to repeat
  4026. the music. When set to zero, however, the music will continue
  4027. playing forever (and ever -- you stay in my heart).
  4028.  
  4029.  
  4030. StartSample (Procedure)                                TGK_SND
  4031. ──────────────────────────────────────────────────────────────
  4032.   StartSample (Var Sample:SampleType; Times:Byte);
  4033.  
  4034. Starts playback of the digital-sound stored in [Sample], if
  4035. any, that is, through the active DACDevice. You've guessed it
  4036. already; [Times] specifies the number of times to repeat the
  4037. sample. When set to zero, however, the sample will continue
  4038. playing forever (and I will love you forever -- and ever).
  4039.  
  4040.  
  4041. StartTimer (Procedure)                                 TGK_SND
  4042. ──────────────────────────────────────────────────────────────
  4043.   StartTimer(TimerNr:Byte);
  4044.  
  4045. Starts the timer specified in [TimerNr], which must be in the
  4046. range 1..5. The timer will be reset to 0 and then start coun-
  4047. ting up at a speed of 128 ticks/second (or 7.8125 ms/tick).
  4048.  
  4049.  
  4050. StopMusic (Procedure)                                  TGK_SND
  4051. ──────────────────────────────────────────────────────────────
  4052.  
  4053. Stops the currently playing FM-Music, if any.
  4054.  
  4055.  
  4056. StopSample (Procedure)                                 TGK_SND
  4057. ──────────────────────────────────────────────────────────────
  4058.  
  4059. Stops the currently playing digital-sound, if any.
  4060.  
  4061.  
  4062. StringButtonResult (Function)                          TGK_WIN
  4063. ──────────────────────────────────────────────────────────────
  4064.   StringButtonResult(Window:WindowType; Nr:Word) : String;
  4065.  
  4066. Returns the current value for button number [Nr] on window
  4067. [Window], a button of type stringbutton. For a programming
  4068. example, look under CheckButtonResult.
  4069.  
  4070.  
  4071. StringWidth (Function)                                TGK_TEXT
  4072. ──────────────────────────────────────────────────────────────
  4073.   StringWidth(S:String) : Word;
  4074.  
  4075. Returns the width of string [S] in pixels, accounting for the
  4076. current textsize, font and spacing.
  4077.  
  4078.  
  4079. StringWindow (Function)                                TGK_WIN
  4080. ──────────────────────────────────────────────────────────────
  4081.   StringWindow(X,Y,XSize,Pa:Word;
  4082.                Title,StartStr:String) : String;
  4083.  
  4084. Pops up a window at (X,Y) on page [Pa], sized at [XSize]
  4085. pixels horizontally, entitled [Title]. [StartStr] contains the
  4086. string to start with and the function-result returned will be
  4087. the new string. 
  4088.  
  4089.  
  4090. SwapByte (Procedure)                                  TGK_MAIN
  4091. ──────────────────────────────────────────────────────────────
  4092.   SwapByte(Var A,B:Byte);
  4093.  
  4094. Exchanges the values of the byte variables [A] and [B]. Thus
  4095. after a call to SwapByte, [A] will contain [B]'s original
  4096. value and vice versa.
  4097.  
  4098.  
  4099. SwapInt (Procedure)                                   TGK_MAIN
  4100. ──────────────────────────────────────────────────────────────
  4101.   SwapInt(Var A,B:Integer);
  4102.  
  4103. Exchanges the values of the integer variables [A] and [B].
  4104. Thus after a call to SwapInt, [A] will contain [B]'s original
  4105. value and vice versa.
  4106.  
  4107.  
  4108. SwapWord (Procedure)                                  TGK_MAIN
  4109. ──────────────────────────────────────────────────────────────
  4110.   SwapWord(Var A,B:Word);
  4111.  
  4112. Exchanges the values of the word variables [A] and [B]. Thus
  4113. after a call to SwapWord, [A] will contain [B]'s original
  4114. value and vice versa.
  4115.  
  4116.  
  4117. Sync (Procedure)                                      TGK_MAIN
  4118. ──────────────────────────────────────────────────────────────
  4119.  
  4120. This procedure waits for a vertical retrace to occur on your
  4121. VGA-card. During the vertical retrace you have some time to
  4122. update the screen, without the user noticing anything of it,
  4123. so if you call this procedure right before you swap pages
  4124. useing the SetPage procedure, the latter will do it's job much
  4125. more smoothly.
  4126.  
  4127.  
  4128. TextModeType (Type)                                   TGK_TEXT
  4129. ──────────────────────────────────────────────────────────────
  4130.   TextModeType = (Speed, Precision);
  4131.  
  4132. Used by SetTextMode to set either one of the text-display
  4133. modes. For more information on how these work, have a look
  4134. under the SetTextMode header.
  4135.  
  4136.  
  4137. TextSettingsType (Type)                               TGK_TEXT
  4138. ──────────────────────────────────────────────────────────────
  4139.   TextSettingsType = Record
  4140.                       ActiveFont,Spacing : Byte;
  4141.                       TextSize           : Word;
  4142.                       Prop               : Boolean;
  4143.                       HJustify,VJustify  : Byte;
  4144.                       TextMode           : TextModeType;
  4145.                      End;
  4146.  
  4147. This record is used by GetTextSettings and SetTextSettings to
  4148. store and retrieve important information on settings regarding
  4149. character-spacing, the active font, justification etc. 
  4150.  
  4151.  
  4152. TimerTicks (Function)                                  TGK_SND
  4153. ──────────────────────────────────────────────────────────────
  4154.   TimerTicks(TimerNr:Byte):Word;
  4155.  
  4156. Returns the number of ticks passed for timer [TimerNr] since
  4157. the last call to StartTimer for the appropriate timer or since
  4158. program start. [TimerNr] must be in the range 1..5. If a long
  4159. period of time (more than about 8.5 seconds) has passed since
  4160. the last call or since program start, the timer will have
  4161. overflown and reset to zero. Results for timings over longer
  4162. periods are thus inaccurate, or useless, if you like 8-)
  4163.  
  4164.  
  4165. TopText (Const)                                       TGK_TEXT
  4166. ──────────────────────────────────────────────────────────────
  4167.   TopText = 2;
  4168.  
  4169. Used in conjunction with SetTextJustify, for more information
  4170. on how this procedure works, have a look under the appropriate
  4171. header.
  4172.  
  4173.  
  4174. Triangle (Procedure)                                    TGK_GP
  4175. ──────────────────────────────────────────────────────────────
  4176.   Triangle(Triangle:TriangleType; Pa:Word);
  4177.  
  4178. Draws a triangle as specified in [Triangle] on page [Pa]. Will
  4179. clip to the current viewport. For more info on how a variable
  4180. of type TriangleType is built up, have a look under the 
  4181. TriangleType header.
  4182.  
  4183.  
  4184. TriangleType (Type)                                     TGK_GP
  4185. ──────────────────────────────────────────────────────────────
  4186.   TriangleType = Record
  4187.                   X,Y : Array[1..3] of Integer;
  4188.                   Col : Byte;
  4189.                  End;
  4190.  
  4191. This type is used in conjunction with Triangle and FTriangle
  4192. to define a triangular shape with. The X- and Y-arrays contain
  4193. the coordinates for each corner of the triangle, whereas [Col]
  4194. contains the color to be used when drawing the triangle. 
  4195.  
  4196.  
  4197. UnPackData (Function)                                 TGK_FILE
  4198. ──────────────────────────────────────────────────────────────
  4199.   UnPackData(Var DataIn,DataOut; 
  4200.            NrIn:Word; Var NrOut:Word) : Boolean;
  4201.  
  4202. Will decompress the data pointed to by [DataIn] for [NrIn]
  4203. bytes. The resulting (decompressed) data will be stored in
  4204. [DataOut] and the size of this block will be returned in
  4205. [NrOut]. You should know in advance what the size of the
  4206. decompressed data [NrOut] will be and allocate enough memory
  4207. for [DataOut]. Returns false if the data could not be decom-
  4208. pressed, otherwise true.
  4209.  
  4210.  
  4211. UpString (Function)                                   TGK_MAIN
  4212. ──────────────────────────────────────────────────────────────
  4213.   UpString(Str:String):String;
  4214.  
  4215. Converts the string [Str] to its uppercase equivalent and
  4216. returns this new string as a function-result.
  4217.  
  4218.  
  4219. UseMask (Variable)                                    TGK_ANIM
  4220. ──────────────────────────────────────────────────────────────
  4221.   UseMask : Boolean;
  4222.  
  4223. [UseMask] specifies whether a call to HandleAnimation will use
  4224. the mask page to display the animation or not. When [UseMask]
  4225. is set to false HandleAnimation won't check for a mask on the
  4226. mask page, otherwise it will. For an extensive description on
  4227. how the mask page works, have a look at SpriteType and PutIma-
  4228. geM (Actually, PutImageM will be called by HandleAnimation if
  4229. UseMask is set to true).
  4230.  
  4231.  
  4232. UserActivity (Function)                                 TGK_IO
  4233. ──────────────────────────────────────────────────────────────
  4234.   UserActivity : Boolean;
  4235.  
  4236. Returns true if the user has either moved the mouse since the
  4237. last coordinates passed by the mousedriver or if the user has
  4238. pressed a key.
  4239.  
  4240.  
  4241. VLine (Procedure)                                       TGK_GP
  4242. ──────────────────────────────────────────────────────────────
  4243.   VLine(X1,Y1,Y2:Integer; Color:Byte; Pa:Word);
  4244.  
  4245. Draws a vertical line from (X1,Y1) to (X1,Y2) on page [Pa],
  4246. using color [Color]. Clips to the current viewport.
  4247.  
  4248.  
  4249. WaitTimer (Procedure)                                  TGK_SND
  4250. ──────────────────────────────────────────────────────────────
  4251.   WaitTimer(TimerNr:Byte; Ticks:Word; Reset:Boolean);
  4252.  
  4253. Waits until timer number [TimerNr] has reached [Ticks] ticks
  4254. (or [Ticks]/128 seconds). If [Reset] is set to true, the timer
  4255. will be reset to zero after this operation.
  4256.  
  4257.  
  4258. WaveType (Type)                                         TGK_BM
  4259. ──────────────────────────────────────────────────────────────
  4260.   WaveType = Array[0..319] of Integer;
  4261.  
  4262. This type is used by the procedure Setwave. For more info,
  4263. take a look over there.
  4264.  
  4265.  
  4266. WDefault, WCloseable, WMoveable (Constants)            TGK_WIN
  4267. ──────────────────────────────────────────────────────────────
  4268.   WDefault   = 0;
  4269.   WCloseable = 1;
  4270.   WMoveable  = 2;
  4271.  
  4272. Constants used by InitWindow to determine some aspects of
  4273. the window. Using WDefault will cause a window not to have a
  4274. "Close"-button, neither can it be moved. 
  4275. By adding in WCloseable and/or WMoveable, these options can
  4276. be changed. Tâdaah! Example:
  4277.  
  4278.  Var MyWin : WindowType;
  4279.  
  4280.  InitWindow(MyWin,10,10,100,100,'Pizza Delivery');
  4281.  OpenWindow(MyWin,WCloseable+WMoveable,0);
  4282.   Repeat 
  4283.   until HandleWindow(MyWin)=0;
  4284.  CloseWindow(MyWin);
  4285.  
  4286. This piece of code will open a simple window which can be
  4287. moved around the screen by clicking on its border. It will
  4288. wait until the window is closed by clicking on the "Close"-
  4289. button in the upperleft corner of the window.
  4290.  
  4291.  
  4292. WinBut (Type)                                          TGK_WIN
  4293. ──────────────────────────────────────────────────────────────
  4294.  
  4295. Internal type used by TGK_WIN, of no further interest to the
  4296. user.
  4297.  
  4298.  
  4299. WindowColorSet (Type)                                  TGK_WIN
  4300. ──────────────────────────────────────────────────────────────
  4301.   WindowColorSet = Record
  4302.                     Line,BackGround,Button,
  4303.                     Text,FillStyle,Bright,
  4304.                     Dim,Bar,Finch,BarFill   : Byte;
  4305.                    End;
  4306.  
  4307. This is a type used by GetWindowColors and SetWindowColors to
  4308. create your personal "windowing-look". Each field in this
  4309. record contains the color (or fill) constant for a part of the
  4310. window. Experiment with what field changes what aspect.
  4311.  
  4312.  
  4313. WindowType (Type)                                      TGK_WIN
  4314. ──────────────────────────────────────────────────────────────
  4315.   WindowType = Record
  4316.                 { Loads-o-Junk }
  4317.                 Buttons : Array[1..MaxButtons] Of ButtonType;
  4318.                End;
  4319.  
  4320. This type is used to describe a complete window. Only the
  4321. Buttons field is of interest to the user. For more information
  4322. on what you can do with this field, have a look at ButtonType.
  4323.  
  4324.  
  4325. WireColor (Procedure)                                   TGK_3D
  4326. ──────────────────────────────────────────────────────────────
  4327.   WireColor(Color:Byte);
  4328.  
  4329. Sets the color to be used to "connect-the-dots", when drawing
  4330. vector-objects on screen with DrawObjectWireFrame.
  4331.  
  4332.  
  4333. XorLine (Procedure)                                     TGK_GP
  4334. ──────────────────────────────────────────────────────────────
  4335.   XorLine(X1,Y1,X2,Y2:Integer; Pa:Word);
  4336.  
  4337.  
  4338. Draws an inverted line from (X1,Y1) to (X2,Y2) on page [Pa].
  4339. Will either clip to the current viewport or not, depending on
  4340. the current setting of LineClipping.
  4341.  
  4342.  
  4343. XorPixel (Procedure)                                    TGK_GP
  4344. ──────────────────────────────────────────────────────────────
  4345.   XorPixel(X,Y:Integer; Pa:Word);
  4346.  
  4347. Inverts the value of the pixel at coordinates (X,Y) on page
  4348. [Pa]. Clips to the current viewport.
  4349.  
  4350.  
  4351. XorRectangle (Procedure)                                TGK_GP
  4352. ──────────────────────────────────────────────────────────────
  4353.   XorRectangle(X1,Y1,X2,Y2:Integer; Pa:Word);
  4354.  
  4355. Draws an inverted rectangle on page [Pa]. The coordinate-pair
  4356. (X1,Y1) denotes the upperleft corner of the rectangle, whereas
  4357. (X2,Y2) denotes the lowerright corner. Clips to the current
  4358. viewport.
  4359.  
  4360.  
  4361. XorSquare (Procedure)                                   TGK_GP
  4362. ──────────────────────────────────────────────────────────────
  4363.   XorSquare(X1,Y1,Size:Integer; Pa:Word);
  4364.  
  4365. Draws an inverted square on page [Pa]. The coordinate-pair
  4366. (X1,Y1) denotes the upperleft corner of the square, whereas
  4367. (X1+Size,Y1+Size) denotes the lowerright corner. Clips to the
  4368. current viewport.
  4369.  
  4370.  
  4371. Yes (Constant)                                         TGK_WIN
  4372. ──────────────────────────────────────────────────────────────
  4373.   Yes = True;
  4374.  
  4375. May be used to test the result of a call to QuestionWindow for
  4376. a positive answer. Alas, it makes your code look neat, but
  4377. there is no further function... 8-)
  4378.  
  4379.  
  4380. ZeroLine (Procedure)                                    TGK_GP
  4381. ──────────────────────────────────────────────────────────────
  4382.   ZeroLine(X1,Y1,X2,Y2:Integer; Color:Byte; Pa:Word);
  4383.  
  4384. Draws a line from (X1,Y1) to (X2,Y2) on page [Pa], using color
  4385. [Color]. Pixels will only be drawn if they had a previous
  4386. value of 0. Thus, pixels will be put "behind" existing data
  4387. only. Will either clip to the current viewport boundaries or
  4388. not, depending on the setting of LineClipping.
  4389.  
  4390.  
  4391. ZeroPixel (Procedure)                                   TGK_GP
  4392. ──────────────────────────────────────────────────────────────
  4393.   ZeroPixel(X,Y:Integer; Color:Byte; Pa:Word);
  4394.  
  4395. Puts a pixel at the coordinates (X,Y) on page [Pa], using
  4396. color [Color], only if this pixel had a previous value of 0.
  4397. Thus, pixels will be put "behind" existing data only. Will
  4398. clip to the current viewport boundaries.
  4399. Appendix A: Keyboard Scancodes
  4400.  
  4401.  
  4402. When using the G∙A∙M∙E-keytable to check whether a key is
  4403. currently being pressed, here are the various scan-codes you
  4404. will need to use. Please take notice that a typical key can
  4405. create different characters, such as "4" and "$" or "q" and
  4406. "Q", depending on whether a shift-key is pressed. Thus, when
  4407. "1" is pressed, Keytable[$02] is true and when "!" is pressed,
  4408. Keytable[$02] and either Keytable[$2A] or Keytable[$36] are
  4409. true. Allright, here are the scancodes:
  4410.  
  4411. "A" - $1E      "H" - $23      "O" - $18      "V" - $2F
  4412. "B" - $30      "I" - $17      "P" - $19      "W" - $11
  4413. "C" - $2E      "J" - $24      "Q" - $10      "X" - $2D
  4414. "D" - $20      "K" - $25      "R" - $13      "Y" - $15 
  4415. "E" - $12      "L" - $26      "S" - $1F      "Z" - $2C
  4416. "F" - $21      "M" - $32      "T" - $14
  4417. "G" - $22      "N" - $31      "U" - $16
  4418.  
  4419. "1" - $02      "6" - $07       F1 - $3B       F6 - $40
  4420. "2" - $03      "7" - $08       F2 - $3C       F7 - $41
  4421. "3" - $04      "8" - $09       F3 - $3D       F8 - $42
  4422. "4" - $05      "9" - $0A       F4 - $3E       F9 - $43
  4423. "5" - $06      "0" - $0B       F5 - $3F      F10 - $44
  4424.  
  4425. "-" - $0C      "=" - $0D      "[" - $1A      "]" - $1B
  4426. ";" - $27      "'" - $28 
  4427. "," - $33      "." - $34      "/" - $35
  4428.  
  4429. "Space"            - $39      "~" (tilde)        - $29
  4430. "|"                - $2B      "Escape"           - $01
  4431. "Backspace"        - $0E      "Ctrl"             - $1D
  4432. "Left-shift"       - $2A      "Caps-Lock"        - $3A
  4433. "Scroll-Lock"      - $46      "Tab"              - $0F
  4434. "Enter"            - $1C      "Right-shift"      - $36
  4435. "Printscreen"      - $37      "Alt"              - $38
  4436. "Home"             - $47      "Up arrow"         - $48
  4437. "Page up"          - $49      "Minus" (keypad)   - $4A
  4438. "Left arrow"       - $4B      "Middle" (kpad-5)  - $4C
  4439. "Right arrow"      - $4D      "Plus" (keypad)    - $4E
  4440. "End"              - $4F      "Down arrow"       - $50
  4441. "Page down"        - $51      "Insert"           - $52
  4442. "Delete"           - $53      "Num-lock"         - $45
  4443.  
  4444. F11 - $D9
  4445. F12 - $DA